Ich habe versucht, django 1.8Django 1.8 Senden von Mail SMTP gmail mit
Mein settings.py enthält mit smtp.gmail.com in eine E-Mail senden:
EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 465
EMAIL_HOST_USER = '' sarath4coding
EMAIL_HOST_PASSWORD = '*********'
DEFAULT_EMAIL_FROM = ‚sa [email protected]‘
from django.core import mail
mail.send_mail('subject','message','[email protected]',['[email protected]'])
aber habe diesen Fehler
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/manager/dj1.8/local/lib/python2.7/site-packages/django/core/mail/__init__.py", line 62, in send_mail
return mail.send()
File "/home/manager/dj1.8/local/lib/python2.7/site-packages/django/core/mail/message.py", line 303, in send
return self.get_connection(fail_silently).send_messages([self])
File "/home/manager/dj1.8/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 100, in send_messages
new_conn_created = self.open()
File "/home/manager/dj1.8/local/lib/python2.7/site-packages/django_smtp_ssl.py", line 14, in open
self.connection.login(self.username, self.password)
File "/usr/lib/python2.7/smtplib.py", line 622, in login
raise SMTPAuthenticationError(code, resp)
SMTPAuthenticationError: (534, '5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbuze\n5.7.14 2FDKQt2Dlo2vqFIvbr6DnBItwWvh9DChPwbeTZO66N91gzmiA437Vqs80cZ9-8u13vxq5a\n5.7.14 bVahzO_BQcZ53yKbJ-YbAlmFE1XIK7MfH97O0wI1lvzpTG_WAHuTIBF0HD1GA2icUoUemt\n5.7.14 ErZn4qb942aAIMG103FnrzLp4txXTbXC-wGLpaz5yvnUN5thahvv3-RiIVW8F1QddZKZlg\n5.7.14 qQKpqWw56zr1AcO2s_oaBEt556fQ> Please log in via your web browser and\n5.7.14 then try again.\n5.7.14 Learn more at\n5.7.14 https://support.google.com/mail/answer/78754 kx14sm6579665pab.0 - gsmtp')
ich alles versucht, das Dokument sagt und folgten viele Lösungsvorschläge.
wie https://accounts.google.com/DisplayUnlockCaptcha, ermöglicht niedrige Sicherheit Anwendungen usw.
aber ich habe immer noch Fehler
Kann jemand sagen, wie man richtig Django 1.8 zu konfigurieren, E-Mail senden Google Mail verwenden.
ich eine ähnliche Konfiguration hatte aber mit: 'EMAIL_HOST_USER '= sarath4coding @ gmail.com'' und' EMAIL_PORT = 587' und 'EMAIL_USE_TLS = true' – Gocht