Probleme mit Django versenden von E-Mails wenn smtp.gmail.com

Ich versuche zu konfigurieren Django ' s send_email, so kann ich senden Passwort-reset-E-Mails an Benutzer. So weit ich ' ve hatte kein Glück daran, es zu arbeiten. Ich habe eine einfache Google-Mail-Konto (keine Google-App, etc) und in meinem Django settings.py ich habe:

EMAIL_HOST      = 'smtp.gmail.com'
EMAIL_HOST_PASSWORD = 'my_password'
EMAIL_HOST_USER = '[email protected]'
EMAIL_PORT      = 587
MAIL_USE_TLS   = True

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
DEFAULT_FROM_EMAIL  = '[email protected]'

Dann versuche ich, um zu testen, indem wir tun:

python manage.py shell
>>> from django.core.mail import send_mail
>>> send_mail('test', 'test', '[email protected]', ['[email protected]'])

und ich bekomme die Fehlermeldung

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.

Hat jemand eine Idee, was Los ist! Jeder Hinweis ist willkommen!

InformationsquelleAutor Yue Y | 2013-11-02
Schreibe einen Kommentar