brack3t / Djrill

[INACTIVE/UNMAINTAINED] Djrill is an email backend and new message class for Django users that want to take advantage of the Mandrill transactional email service from MailChimp.
BSD 3-Clause "New" or "Revised" License
319 stars 64 forks source link

Error sending a Unicode in body. Python 2 #76

Closed zkanda closed 10 years ago

zkanda commented 10 years ago
    msg = EmailMultiAlternatives(
        subject=subject,
        body=u"This is the text email body", #<------
        from_email=from_email,
        to=["test@example.com"],
    )

throws MandrillAPIError. stacktrace raised unexpected: HTTPError() Traceback (most recent call last): File "/home/zkanda/.virtualenvs/project/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task R = retval = fun(_args, _kwargs) File "/home/zkanda/.virtualenvs/project/local/lib/python2.7/site-packages/celery/app/trace.py", line 437, in protected_call return self.run(_args, _kwargs) File "/home/zkanda/project/project/project/tasks.py", line 28, in send_message msg.send() File "/home/zkanda/.virtualenvs/project/local/lib/python2.7/site-packages/django/core/mail/message.py", line 274, in send return self.get_connection(fail_silently).send_messages([self]) File "/home/zkanda/.virtualenvs/project/local/lib/python2.7/site-packages/djrill/mail/backends/djrill.py", line 68, in send_messages sent = self._send(message) File "/home/zkanda/.virtualenvs/project/local/lib/python2.7/site-packages/djrill/mail/backends/djrill.py", line 119, in _send (msg_dict['to'], msg_dict['from_email'])) MandrillAPIError

medmunds commented 10 years ago

I'm not able to reproduce this using Python 2.7 and Django 1.6, with the unicode body you reported (and a simple subject string).

Could you provide the status_code and response attributes from the MandrillAPIError, so we can see why Mandrill is failing the send call? (You may also find relevant info in the Mandrill console, under Settings > API Logs -- they show the last 100 failed calls.)

zkanda commented 10 years ago

Thanks for pointing out the API Logs.. closing as invalid.