Skip to content

Instantly share code, notes, and snippets.

@daddyYukio
Last active April 12, 2023 06:26
Show Gist options
  • Save daddyYukio/8dee5d89e80ef71713c514a4ce9a105a to your computer and use it in GitHub Desktop.
Save daddyYukio/8dee5d89e80ef71713c514a4ce9a105a to your computer and use it in GitHub Desktop.
検知メールをGmailで送信(Pythonでやってみる編)
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