Closed kootenpv closed 7 years ago
what really you want to do here.
@shahidash Allow people to send emails from gmail using OAuth2 rather than username and password.
@kootenpv in short you want the user should authorize yagmail to sent mails from there account instead of storing the username/password , we would store the access_token of user. which we will get after Oauth stuff
@shahidash Indeed. I noticed this script, maybe it can be useful https://raw.githubusercontent.com/google/gmail-oauth2-tools/master/python/oauth2.py I would like it if yagmail would be super simple and help people get OAuth2 working
Hi @kootenpv ,
I would like to look into this issue. I'll start working on this in a couple of days :)
Added oauth2 support in https://github.com/kootenpv/yagmail/commit/22cb687adc67fd9b16f870e5e658a3fa77ca67ac
(0.7.x onwards)
I'm looking for someone who would want to write OAuth2 for yagmail. Remember: the goal of yagmail is to make it stupid simple for people to safely send emails with HTML, inline images and attachments.
Story:
Currently, I feel like yagmail provides plenty of options of running safely on a local PC. Passwordless scripts, getpass, manual password.
However, there are many situations in which people will want to automate a script (see also #16). This is not possible at the moment with a cronjob unfortunately; unless one is allowing a terminal to contain username/password, or some script to hold the username/password combination.
OAuth2, while a lot of effort to setup, would most certainly cater to other use cases / groups of people.
Implementation details: try to make it fit with the current code (no username/password, but oauth stuff as arguments), and I appreciate PEP8.