Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No mails sent with django 1.10.1 #4

Open
jacopsd opened this issue Oct 28, 2016 · 7 comments
Open

No mails sent with django 1.10.1 #4

jacopsd opened this issue Oct 28, 2016 · 7 comments

Comments

@jacopsd
Copy link

jacopsd commented Oct 28, 2016

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

@kidig
Copy link
Owner

kidig commented Oct 30, 2016

Did you fill the settings.py with your mailjet keys?

@jacopsd
Copy link
Author

jacopsd commented Oct 30, 2016

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 #4 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAM0XtpB_GnZnrESBuL309z8CnGx24Ntks5q5GabgaJpZM4KjwQB.

@kidig
Copy link
Owner

kidig commented Oct 30, 2016

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.

@jacopsd
Copy link
Author

jacopsd commented Oct 30, 2016

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 #4 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAM0XkO9G6Jj_ink0Al_FltKx2p1Zjnrks5q5JWEgaJpZM4KjwQB.

@jacopsd jacopsd changed the title NO mails sent with django 1.10.1 No mails sent with django 1.10.1 Nov 1, 2016
@xordoquy
Copy link

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.

@lorddaedra
Copy link
Contributor

If this issue was fixed, can we close it?..

@anentropic
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants