Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mandrill "reject_reason":"unsigned"

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?

like image 459
Pranav Singh Avatar asked Jul 13 '16 15:07

Pranav Singh


1 Answers

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

  • https://mandrillapp.com/api/docs/messages.html
  • https://mandrill.zendesk.com/hc/en-us/articles/205582247-About-Domain-Verification
  • https://mandrill.zendesk.com/hc/en-us/articles/205582267-About-SPF-and-DKIM

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-

like image 101
Pranav Singh Avatar answered Nov 02 '22 05:11

Pranav Singh