Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/python3
- import smtplib
- from email.mime.text import MIMEText
- #送信元メールアドレスを指定
- from_address = ""
- #送信先メールアドレスを指定
- to_address = ""
- #SMTPメールサーバーのホスト指定
- smtp_server = ""
- #SMTPサーバーのユーザ名指定
- smtp_username = ""
- #SMTPサーバーのパスワード指定
- smtp_password = ""
- message = "ダッシュボタンが押されました"
- msg = MIMEText(message)
- msg["Subject"] = message
- msg["From"] = from_address
- msg["To"] = to_address
- s = smtplib.SMTP(smtp_server, 587)
- s.login(smtp_username, smtp_password)
- s.sendmail(from_address, [to_address], msg.as_string())
- s.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement