31

I'm trying to send emails using mandrill email service but I get the following error:

[
    {
        "email": "pranav_withyou@hotmail.com",
        "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?

Pranav Singh
  • 17,079
  • 30
  • 77
  • 104
  • Possible duplicate of [mandril Reject Reason: unsigned](http://stackoverflow.com/questions/37492052/mandril-reject-reason-unsigned) – boroboris Aug 19 '16 at 08:23

1 Answers1

43

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.

enter image description here

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-

Pranav Singh
  • 17,079
  • 30
  • 77
  • 104
  • 2
    Thanks for the well formatted response, really save me a ton of headache. It seems like our SPF record was syntactically incorrect for a long time (multiple, independent SPF records in one TXT record). It seems like for some time this was not a problem for Mandrill, then something changed which caused our emails to get blocked from sending... your commend helped me zero in on the issue very quickly – Jkk.jonah Oct 11 '19 at 18:22
  • you have field for fromName and from ; make sure they match your domain to guarantee its working, or you can add another domain and verify it then use that if that's the requirment – shareef Feb 01 '23 at 11:37