kootenpv / yagmail

Send email in Python conveniently for gmail using yagmail
MIT License
2.64k stars 263 forks source link

App Password not available for my gmail account. How should I authenticate? #250

Open aa-dank opened 2 years ago

aa-dank commented 2 years ago

This related to the sunsetting of the less-secure-app-access. Seems there could be some improvements to authentication documentation, these issues keep popping up... I am using an sundry or admin account to send emails, per instructions for authenticating for using app passwords, the app passwords are not available for this account. What is the work around? I don't think 2FA is available for this admin account. Screenshot 2022-08-29 173754

kootenpv commented 2 years ago

Seems there could be some improvements to authentication documentation, these issues keep popping up...

Please do get involved and fix docs. I'm currently at an all time low of sending emails, and app password is working fine for me

I'd really double check 2fa as it's really a requirement for app password I believe

Otherwise maybe you can try oauth2

yasinelabe commented 1 year ago

Here Gmail says it stopped less secure apps feature, which infact Yagmail uses for Gmail https://support.google.com/accounts/answer/6010255?hl=en&utm_source=google-account&utm_medium=profile-less-secure-apps-card

kootenpv commented 1 year ago

App specific password still works is what it says at the end of the page

speedy-10 commented 1 year ago

Hi, I've the same problem: My old account of gmail still works to send mails. But I want to create a new account that should work too. I tried a yahoo-account, but get typical error message: {{{ $ python3 program.py

Traceback (most recent call last): File "/home/USER/Downloads/python_mail_senden/program.py", line 62, in yag.send( File "/home/USER/.local/lib/python3.10/site-packages/yagmail/sender.py", line 156, in send self.login() File "/home/USER/.local/lib/python3.10/site-packages/yagmail/sender.py", line 210, in login self._login(self.credentials) File "/home/USER/.local/lib/python3.10/site-packages/yagmail/sender.py", line 229, in _login self.smtp.login(self.user, password) File "/usr/lib/python3.10/smtplib.py", line 750, in login raise last_exception File "/usr/lib/python3.10/smtplib.py", line 739, in login (code, resp) = self.auth( File "/usr/lib/python3.10/smtplib.py", line 662, in auth raise SMTPAuthenticationError(code, resp) smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials bx1-20020a170906a1c100b00992665694f7sm5584427ejb.107 - gsmtp') }}} Does someone know an e-mail provider which still works with yagmail?