Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var email = { "ID": "someID", "Body": "whatever" };
- var json = '{tmpEmail:' + JSON.stringify(email) + '}';
- $.ajax({
- type: "POST",
- url: "send.aspx/SendMessage",
- contentType: "application/json; charset=utf-8",
- data: json,
- dataType: "text",
- success: function (output) {
- alert('Message Sent')
- },
- error: function (output) {
- alert('error');
- }
- });
- <WebMethod> _
- <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _
- Public Shared Async Function SendMessage(tmpEmail As tmpEmail) As Threading.Tasks.Task(Of String)
- Dim _EmailID As Guid
- _EmailID = Await EmailFunctions.SendEmail(tmpEmail)
- Return "Hey it works"
- End Function
- Public Shared Async Function SendEmailLead(obj as tmpEmail) As Task(Of Guid)
- Dim PClient As New PostmarkDotNet.PostmarkClient(APIKey)
- Dim Result As PostmarkDotNet.PostmarkResponse = await PClient.SendMessageAsync(obj)
- If Result.Status = PostmarkDotNet.PostmarkStatus.Success Then
- ...
- Return LogID
- Else
- ... throw some exception
- End If
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement