E-mail sending... but.. not sending?

16 views
Skip to first unread message

grwhumphries

unread,
Jul 9, 2019, 10:46:23 AM7/9/19
to Django users
I've got a bit of a mystery.  I've got a Django Wagtail project with Spirit as an added app.   I'm trying to get the e-mail system working...

I've included the following in settings/base.py
EMAIL_NAME = 'mye...@gmail.com'

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = EMAIL_NAME
EMAIL_HOST_PASSWORD = PASSWORD
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = EMAIL_NAME

ADMINS = (
('You', EMAIL_NAME),
)

MANAGERS = ADMINS


I then ran the following test

from django.conf import settings
from django.core.mail import send_mail

send_mail('test','test message', 'mye...@gmail.com',['other...@gmail.com'])


The output from this in the console suggests the e-mail sent...

Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: test
From: mye...@gmail.com
To: other...@gmail.com
Date: Tue, 09 Jul 2019 14:14:42 -0000
Message-ID: <randomly generated message ID>

test message
-------------------------------------------------------------------------------


However... nothing arrives at the e-mail address.   All email addresses and passwords are correct and have been double and triple checked.

Any thoughts on to what I might be missing?

Cheers all.




Jani Tiainen

unread,
Jul 9, 2019, 11:24:07 AM7/9/19
to django...@googlegroups.com
Hi.

Looks like your backend isn't right if you see message in the console.

Also if using gmail you have allowed insecure apps?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/22baf6e8-f873-4a56-b497-7c90621d90c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages