Last active
October 1, 2017 22:53
-
-
Save AO8/f7b7120a7d5bef5387961cac3069fa9c to your computer and use it in GitHub Desktop.
Send Gmail with Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allow less secure apps to access your gmail account | |
import email | |
import smtplib | |
fromaddr = "[email protected]" | |
toaddr = "[email protected]" | |
msg = "Content of your email message." | |
username = "yourGmailAddress" | |
password = "yourPassword" | |
server = smtplib.SMTP("smtp.gmail.com:587") | |
server.starttls() | |
server.login(username, password) | |
server.sendmail(fromaddr, toaddr, msg) | |
server.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment