I am trying to configure Django send_email so that I can send reset passwords to users. So far, I have not been able to get it to work. I set up a basic Gmail account (no Google app, etc.), And in my Django settings.py I have:
EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_PASSWORD = 'my_password' EMAIL_HOST_USER = ' my_account@gmail.com ' EMAIL_PORT = 587 MAIL_USE_TLS = True EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' DEFAULT_FROM_EMAIL = ' admin@my-site.com '
Then I will try to verify this by doing:
python manage.py shell >>> from django.core.mail import send_mail >>> send_mail('test', 'test', ' test@test.com ', [' my-personal-email@gmail.com '])
and I get an error
Traceback (most recent call last): File "<console>", line 1, in <module> File "C:\Program Files\Python27\lib\site-packages\django\core\mail\__init__.py ", line 62, in send_mail connection=connection).send() File "C:\Program Files\Python27\lib\site-packages\django\core\mail\message.py" , line 255, in send return self.get_connection(fail_silently).send_messages([self]) File "C:\Program Files\Python27\lib\site-packages\django\core\mail\backends\sm tp.py", line 88, in send_messages new_conn_created = self.open() File "C:\Program Files\Python27\lib\site-packages\django\core\mail\backends\sm tp.py", line 55, in open self.connection.login(self.username, self.password) File "C:\Program Files\Python27\lib\smtplib.py", line 577, in login raise SMTPException("SMTP AUTH extension not supported by server.") SMTPException: SMTP AUTH extension not supported by server.
Does anyone have an idea what is happening! Any hint is appreciated!
Yue y source share