Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. var email = { "ID": "someID", "Body": "whatever" };
  2. var json = '{tmpEmail:' + JSON.stringify(email) + '}';
  3. $.ajax({
  4. type: "POST",
  5. url: "send.aspx/SendMessage",
  6. contentType: "application/json; charset=utf-8",
  7. data: json,
  8. dataType: "text",
  9. success: function (output) {
  10. alert('Message Sent')
  11. },
  12. error: function (output) {
  13. alert('error');
  14. }
  15. });
  16.  
  17. <WebMethod> _
  18. <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _
  19. Public Shared Async Function SendMessage(tmpEmail As tmpEmail) As Threading.Tasks.Task(Of String)
  20. Dim _EmailID As Guid
  21. _EmailID = Await EmailFunctions.SendEmail(tmpEmail)
  22. Return "Hey it works"
  23. End Function
  24.  
  25. Public Shared Async Function SendEmailLead(obj as tmpEmail) As Task(Of Guid)
  26. Dim PClient As New PostmarkDotNet.PostmarkClient(APIKey)
  27. Dim Result As PostmarkDotNet.PostmarkResponse = await PClient.SendMessageAsync(obj)
  28. If Result.Status = PostmarkDotNet.PostmarkStatus.Success Then
  29. ...
  30. Return LogID
  31. Else
  32. ... throw some exception
  33. End If
  34. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement