kootenpv / yagmail

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

Less secuirty app option disabled from June 2022 #239

Closed tomnewg closed 2 years ago

tomnewg commented 2 years ago

Hi all,

gmail has disabled the "Less secure apps" functionality. Therefore yagmail is not working anymore for gmail. Is there a way around it? Does yagmail need an upgrade or will it just not be possible going forward to use yagmail for gmail accounts?

Many thanks for your help

Tom

tomnewg commented 2 years ago

Just to add, I did try to add an "App password" but I still get the same error.

https://stackoverflow.com/questions/72478573/sending-and-email-using-python-problem-causes-by-last-google-policy-update

safelysparky commented 2 years ago

@tomnewg just set up the app password in google account security and replace the old email password with the app password (a long sequence of letters, do not forget to copy it before close the window!) in your code, then it works fine now in yagmail. During the app password setup, make sure the app you selected is mail, also the device you selected matches the machine on which your code is running (e.g. window computer). I hope this helps!