Published
- 1 min read
send email with jquerymonly
The solution for this is noted below
send email with jquerymonly
Solution
function sendRequest() {
var method = 'POST'
var serviceUrl = 'https://api.enginemailer.com/RESTAPI/Submission/SendEmail'
var email = {
UserKey: 'your_userID_given_by_Enginemailer',
ToEmail: $('#ToEmail').val(),
Subject: $('#Subject').val(),
SenderEmail: $('#SenderEmail').val(),
SenderName: $('#SenderName').val(),
SubmittedContents: $('#SubmittedContent').val(),
Attachments: $('#Attachments').val()
}
$.ajax({
type: method,
url: serviceUrl,
data: JSON.stringify(email),
contentType: 'application/json; charset=utf-8',
traditional: true
})
.done(function (data) {
$('#value1').text(data)
})
.error(function (jqXHR, textStatus, errorThrown) {
$('#value1').text(jqXHR.responseText || textStatus)
})
}
Try other methods by searching on the site. That is if this doesn’t work