Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import smtplib
- def email_alert(message, addresses):
- fromaddr = 'email address to send from'
- username = 'username of email to send from'
- password = 'password of email to send from'
- server = smtplib.SMTP('smtp.gmail.com:587')
- server.starttls()
- server.login(username, password)
- for address in addresses:
- server.sendmail(fromaddr, address, message)
- server.quit()
Add Comment
Please, Sign In to add comment