I'm trying to send emails using mandrill email service but I get the following error:
[
{
"email": "[email protected]",
"status": "rejected",
"_id": "daab0daa538a4fe9b161be709593be0b",
"reject_reason": "unsigned"
}
]
I am trying to send email using ajax call in javascript like :
$.ajax({
type: "POST",
url: "https://mandrillapp.com/api/1.0/messages/send.json",
data: {
"key": "RemovedforSecurityitscorrect",
"message": {
"html": "<p>Example HTML content</p>",
"text": $('#emailText').val(),
"subject": $('#emailSubject').val(),
"from_email": $('#fromEmail').val(),
"from_name": $('#fromName').val(),
"to": [{
"email": $('#toEmail').val(),
"name": $('#recipientName').val(),
"type": "to"
}],
"headers": {
"Reply-To": $('#fromName').val()
}
},
success: function (data) {
console.log("Email Sent");
},
error: function (xhr, status, error) {
console.log("Error while sending mail");
}
}
});
all values are coming to ajax call & call is made to server evident from response. What can be issue?
I got the reason, it was silly mistake. I was trying to send mail through my personal email id which is on different domain than to for which Mandrill is configured & verified.
Searching for the reason of error, I found that this error is sent from Mandrill when Mail sent from unverified domains or domains without valid SPF and DKIM records will be rejected with the reject_reason, unsigned.
For more information refer
For doing required setting related to SPF & DKIM for Mandrill please refer:
https://mandrill.zendesk.com/hc/en-us/articles/205582277-How-do-I-add-DNS-records-for-my-sending-domains-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With