Error sending email: raise SMTPAuthenticationError(code, resp)

前端 未结 4 566
甜味超标
甜味超标 2021-01-05 07:12

Im trying to send emails with smtp module, but Im having an error:

File \"/usr/lib/python2.7/smtplib.py\", in login    
 raise SMTPAuthenticationError(code,          


        
相关标签:
4条回答
  • 2021-01-05 07:52

    (534, b'5.7.14 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 h16sm7090987wrc.89 - gsmtp')

    try https://myaccount.google.com/security#connectedapps

    Allow less secure apps: ON Some apps and devices use less secure sign-in technology, which could leave your account vulnerable. You can turn off access for these apps (which we recommend) or choose to use them despite the risks.

    0 讨论(0)
  • 2021-01-05 07:52

    None of the less-secure options worked for me. What worked in the end was setting up 2-factor authentication, and then generating an app-specific password. Instructions here: https://support.google.com/domains/answer/9437157

    0 讨论(0)
  • 2021-01-05 07:53

    I had exactly the same problem. Yes, it worked. By enabling your gmail account security setting -> Allow less secure app, I was able to send a simple email from one gmail to another gmail account.

    WARNING: Allowing low security for apps accessing your Google account is not recommended by google. It can be a security threat. Turn it OFF after the experiment.

    0 讨论(0)
  • 2021-01-05 07:57

    Go to Google's Account Security Settings: www.google.com/settings/security

    Find the field "Access for less secure apps". Set it to "Allowed".

    Try your script again, changing server.sendemail() to server.sendmail()

    0 讨论(0)
提交回复
热议问题