kootenpv / yagmail

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

Looking for contributor who could add OAuth2 to yagmail #36

Closed kootenpv closed 7 years ago

kootenpv commented 8 years ago

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.

shahidash commented 8 years ago

what really you want to do here.

kootenpv commented 8 years ago

@shahidash Allow people to send emails from gmail using OAuth2 rather than username and password.

shahidash commented 8 years ago

@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

kootenpv commented 8 years ago

@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

waseem18 commented 7 years ago

Hi @kootenpv ,

I would like to look into this issue. I'll start working on this in a couple of days :)

kootenpv commented 7 years ago

Added oauth2 support in https://github.com/kootenpv/yagmail/commit/22cb687adc67fd9b16f870e5e658a3fa77ca67ac

(0.7.x onwards)