Advertisement
Guest User

Untitled

a guest
Oct 13th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #! /usr/bin/python3
  2.  
  3. import smtplib
  4.  
  5. from email.mime.text import MIMEText
  6.  
  7. #送信元メールアドレスを指定
  8. from_address = ""
  9. #送信先メールアドレスを指定
  10. to_address = ""
  11. #SMTPメールサーバーのホスト指定
  12. smtp_server = ""
  13. #SMTPサーバーのユーザ名指定
  14. smtp_username = ""
  15. #SMTPサーバーのパスワード指定
  16. smtp_password = ""
  17.  
  18. message = "ダッシュボタンが押されました"
  19.  
  20. msg = MIMEText(message)
  21. msg["Subject"] = message
  22. msg["From"] = from_address
  23. msg["To"] = to_address
  24.  
  25. s = smtplib.SMTP(smtp_server, 587)
  26. s.login(smtp_username, smtp_password)
  27. s.sendmail(from_address, [to_address], msg.as_string())
  28. s.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement