Пожалуйста, я сталкивался с этой ошибкой в течение последних трех дней, я уже проверил все ответы и внес соответствующие исправления, допустил менее безопасные приложения, двухфакторную аутентификацию, перепроверил имя пользователя / пароль, но не из этих справок
settings.py код
SERVER_EMAIL = 'infopython@gmail.com'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_HOST_USER = SERVER_EMAIL
EMAIL_PORT = 587
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
ADMINS = [
('admin', 'admin5@gmail.com'),
]
MANAGERS = ADMINS
Вывод
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
utility.execute()
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 335, in execute
output = self.handle(*args, **options)
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\sendtestemail.py", line 33, in handle
recipient_list=kwargs['email'],
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\mail\__init__.py", line 60, in send_mail
return mail.send()
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\mail\message.py", line 294, in send
return self.get_connection(fail_silently).send_messages([self])
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\mail\backends\smtp.py", line 103, in send_messages
new_conn_created = self.open()
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\mail\backends\smtp.py", line 63, in open
self.connection = self.connection_class(self.host, self.port, **connection_params)
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python37-32\lib\smtplib.py", line 254, in __init__
raise SMTPConnectError(code, msg)
smtplib.SMTPConnectError: (451, b'Request action aborted on MFE proxy, SMTP server is not available.')