-1
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIT_PORT = 587
EMAIL_HOST_USER = 'your@gmail.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_USE_TLS = True
EMAIL_USE_SSL= False


 send_mail(msg,"Thank-You for using our Website ,Mail us if you have any Problem in Our Website.Thank-You Once again" ,
                    settings.EMAIL_HOST_USER,[emailto,],fail_silently=False,)

I cant send mail it showing timeout error even i have tried

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

I cant send the mail instead of that i am getting printed in console box

[11/Sep/2020 23:07:49] "POST / HTTP/1.1" 200 3502
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: Hello User
From: tamilan0tamill@gmail.com
To: bahubali@gmail.com
Date: Fri, 11 Sep 2020 17:39:50 -0000
Message-ID: <159984599099.7876.4877994479538514933@UNIVERSE>

Thank-You for using our Website ,Mail us if you have any Problem in Our Website.
Karthik
  • 2,181
  • 4
  • 10
  • 28
  • I suppose you did not intentionally write `EMAIT_PORT`? – mkrieger1 Sep 11 '20 at 18:16
  • 1
    What is `send_mail`? – mkrieger1 Sep 11 '20 at 18:18
  • 1
    By far the most people having troubles sending mail on SO are using Gmail. You might want to try any other provider. – Klaus D. Sep 11 '20 at 18:36
  • Console backend is for testing purposes you need SMTP backend https://docs.djangoproject.com/en/3.1/topics/email/#smtp-backend @mkrieger1 Django specific mail sending function https://docs.djangoproject.com/en/3.1/topics/email/#send-mail – iklinac Sep 11 '20 at 18:43

1 Answers1

0

Make sure you have removed this line in your settings:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

Making sure the EMAIL_BACKEND is set to:

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

You will also have to go to your Google Account settings and enable Access for less secure apps. You can find steps on this here: https://support.google.com/mail/answer/7126229?visit_id=637354451790607458-1295615873&rd=2#cantsignin

Ryan
  • 2,167
  • 2
  • 28
  • 33