I am currently trying to integrate mandrill into this Django-based website for emails. Djrill is the recommended package for Django and sits in place of the default SMTP/email backend, passing emails through to a Mandrill account.
When I try to test that this new backend is working by running this command:
send_mail('Test email', body, 'noreply@*********.com', [user.email], fail_silently=False)
It throws the following error: http://pastebin.ca/2239978
Can anybody point me to my mistake?
Update:
As @DavidRobinson mentions in a comment, you are not getting a successful response from the mandrill API authentication call. You should double check your API key.
If that is correct, try using curl to post
{"key": <your api key>, "email": <your from email>}toMANDRILL_API_URL + "/users/verify-sender.json"and see if you get a 200.Something like this:
Original answer:
There is also an issue in Djrill that prevents a useful error message from propagating up. That last line of the stack trace is the problem.
This is the entire
openmethod taken from the source:See how it just says
raisewithout an exception argument? That syntax is only allowed inside anexceptblock, and raises the exception currently being handled. It doesn’t work outside anexceptblock.An open issue in Djrill mentions a send failure and links a fork that supposedly fixes it. I suspect Djrill isn’t well supported and you might try that fork or another solution entirely.