Sending email to gmail from local machine using django allauth app

Viewed 315

I am trying to send a real email from my local to gmail using django allauth app.I can see the verification email through the console.

MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Subject: Please Confirm Your E-mail Address
From: myemail@gmail.com
To: useremail@gmail.com
Date: Tue, 08 Aug 2017 15:23:19 -0000
Message-ID: <20170808152319.1056.31735@Lenovo-PC>

From and to email are real gmail account. I was going through django-allauth - Send email verification using Gmail account and settings.py contains the settings for gmail.

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

if DEBUG:
    EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"

But for some reason I am not getting the emails in my gmail account.

Any help is highly appreciated.

1 Answers

Hey You have turned on DEBUG=TRUE and you have use

if DEBUG: EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"

so, when you are in debug then allauth will send mail in the console. Remove above line then you are fine. Check console.

Related