1

i am getting error when send email with django,

 Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/apsijogja/djangogirls/myvenv/local/lib/python2.7/site-packages/django/core/mail/__init__.py", line 62, in send_mail
    return mail.send()
  File "/home/apsijogja/djangogirls/myvenv/local/lib/python2.7/site-packages/django/core/mail/message.py", line 286, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/home/apsijogja/djangogirls/myvenv/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 92, in send_messages
    new_conn_created = self.open()
  File "/home/apsijogja/djangogirls/myvenv/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 59, in open
    self.connection.login(self.username, self.password)
  File "/usr/lib/python2.7/smtplib.py", line 613, in login
    raise SMTPAuthenticationError(code, resp)
SMTPAuthenticationError: (535, '5.7.8 Username and Password not accepted. Learn more at\n5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 g10sm8484662pdm.29 - gsmtp')

this is setting.py

CCOUNT_ACTIVATION_DAYS = 3
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'myemail@gmail.com'
EMAIL_HOST_PASSWORD = 'blahblah'
EMAIL_PORT = 587
EMAIL_USE_TLS = 1

LOGIN_REDIRECT_URL = '/'

i already try with this link https://support.google.com/mail/answer/14257 but i am getting same error.

can you help me solve this problem?

User0511
  • 665
  • 3
  • 11
  • 27
  • Not sure what you mean by "its not working" -- looks like you may be being snagged by a captcha or two-factor authentication; or https://support.google.com/a/answer/176600?hl=en -- "If you connect using SMTP, you can only send mail to Gmail or Google Apps users"... – Alex Martelli Mar 12 '15 at 04:47
  • possible duplicate of [Django SMTPAuthenticationError](http://stackoverflow.com/questions/26697565/django-smtpauthenticationerror) – rnevius Mar 12 '15 at 05:05

0 Answers0