Guest User

Untitled

a guest
Nov 5th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import smtplib
  2.  
  3. def email_alert(message, addresses):
  4. fromaddr = 'email address to send from'
  5. username = 'username of email to send from'
  6. password = 'password of email to send from'
  7.  
  8. server = smtplib.SMTP('smtp.gmail.com:587')
  9. server.starttls()
  10. server.login(username, password)
  11.  
  12. for address in addresses:
  13. server.sendmail(fromaddr, address, message)
  14. server.quit()
Add Comment
Please, Sign In to add comment