django-mailjet
django-mailjet copied to clipboard
No mails sent with django 1.10.1
Filed following issue on the mailjet support channel (see below).
After some back and forth discussions, mailjet support concluded: "Django is not written by us, and it received an update Sept 9th on their github, at that time it stopped working. This is why you must consult Django's support in order to find out what they changed on their side for it to stop working."
So getting back here: did anyone face the same issue? Thank you for your help DJ
I want to send authentication and other mails from a django application using MailJet
SETUP: OSX 10.11.6 using django 1.10.1, python 2.7.10 On my domain, I have entered SPF & DKIM records. They are confirmed to be OK by MailJet status page. Package: django-mailjet=0.2.0
PROBLEM: When I test mailjet using curl from command line, it works fine, but when executing send_mail from python, no mail is sent. Nothing appears in the MailJet stats, but I do get a return value of '1' from the send_mail call:
(venv) Davy@Davys-iMac:~/SWE/gitrepos/django_swingit$ python manage.py shell Python 2.7.10 (default, Oct 23 2015, 19:19:21) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole)
from django.core.mail import send_mail ret = send_mail( ... 'My Subject', ... 'Here is my DJTEST message.', ... '[email protected]', ... ['[email protected]','[email protected]'], ... fail_silently=False, ... ) print ret 1
Did you fill the settings.py with your mailjet keys?
Dear support
Yes, in the sense that the key is in an environment variable and settings.py contains:
EMAIL_USE_TLS = True EMAIL_BACKEND = 'django_mailjet.backends.MailjetBackend' MAILJET_API_KEY = 'f955caea0ef10ca2a5adcede42cee274' MAILJET_API_SECRET = os.environ['MAILJET_API_SECRET']
When I send a test mail, I do this: send_mail('my subject', 'my message', '[email protected]', ['[email protected]']) but nothing is received.
Note: I see also module “mailjet-rest 1.2.2” is installed. Is that required? Could it clash with with “django-mailjet 0.2.0”?
Thank you for your help.
Regards Davy
On 30 Oct 2016, at 10:42, DmitrII Gerasimenko [email protected] wrote:
Did you fill the settings.py with your mailjet keys?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kidig/django-mailjet/issues/4#issuecomment-257141407, or mute the thread https://github.com/notifications/unsubscribe-auth/AAM0XtpB_GnZnrESBuL309z8CnGx24Ntks5q5GabgaJpZM4KjwQB.
Also, please check that your 'from_email' argument matched with one of emails in the Email addresses list - https://app.mailjet.com/account/sender.
And sure, the mailjet-rest package is required. It should be installed automatically with django-mailjet.
Indeed, this is the case:
On 30 Oct 2016, at 14:03, DmitrII Gerasimenko [email protected] wrote:
Also, please check that your 'from_email' argument matched with one of email in the sender list - https://app.mailjet.com/account/sender https://app.mailjet.com/account/sender.
And sure, the mailjet-rest package is required. It should be installed automatically with django-mailjet.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kidig/django-mailjet/issues/4#issuecomment-257149769, or mute the thread https://github.com/notifications/unsubscribe-auth/AAM0XkO9G6Jj_ink0Al_FltKx2p1Zjnrks5q5JWEgaJpZM4KjwQB.
Not an issue with Django. PR #3 should fix the issue. Would be nice to have a new release instead of using git to deploy.
If this issue was fixed, can we close it?..
same problem here
the only thing that's needed to fix it is the change on line #45 in that PR here https://github.com/kidig/django-mailjet/pull/3/files#diff-997f4ed88f1fea09dc499cd59763e7d2R45
without that, if you specify EmailMessage(to=['[email protected]']) then the mailjet backend tries to send 'Recipients': [{'Email': '', 'Name': '[email protected]'}] ...which goes nowhere