How to use the yagmail.oauth2.get_oauth_string function in yagmail

To help you get started, we’ve selected a few yagmail examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kootenpv / yagmail / yagmail / sender.py View on Github external
def login_oauth2(self, oauth2_file):
        self.smtp = smtplib.SMTP(self.host, self.port, **self.kwargs)
        self.smtp.set_debuglevel(self.debuglevel)
        oauth2_info = get_oauth2_info(oauth2_file)
        auth_string = get_oauth_string(self.user, oauth2_info)
        self.smtp.ehlo(oauth2_info["google_client_id"])
        self.smtp.starttls()
        self.smtp.docmd('AUTH', 'XOAUTH2 ' + auth_string)
github kootenpv / yagmail / yagmail / sender.py View on Github external
def get_oauth_string(user, oauth2_info):
        return get_oauth_string(user, oauth2_info)