Last active
April 12, 2023 06:26
-
-
Save daddyYukio/8dee5d89e80ef71713c514a4ce9a105a to your computer and use it in GitHub Desktop.
検知メールをGmailで送信(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
import smtplib | |
YOUR_GMAIL_ADDRESS = "xxxxx@gmail.com" | |
APP_PASSWORD = "xxxxxxxxxxxxxxxx" | |
if __name__ == '__main__': | |
connection = smtplib.SMTP("smtp.gmail.com", 587) | |
connection.set_debuglevel(True) # enable debug output | |
connection.starttls() | |
connection.login(YOUR_GMAIL_ADDRESS, APP_PASSWORD) | |
connection.sendmail(YOUR_GMAIL_ADDRESS, TO_ADDRESS, "TEST Mail from Python!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment