Guest User

Untitled

a guest
Jun 24th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. import smtplib
  5. from email.mime.text import MIMEText
  6.  
  7.  
  8. def postmaster(mfrom, mto, msubject, message, smtphost):
  9.  
  10. msg = MIMEText(message.encode("utf-8"))
  11. msg['Subject'] = msubject
  12. msg['From'] = mfrom
  13. msg['To'] = mto
  14.  
  15. s = smtplib.SMTP(smtphost)
  16. s.sendmail(msg['From'], msg['To'], msg.as_string())
  17. s.quit()
Add Comment
Please, Sign In to add comment