Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # send mail
- import smtplib
- fromaddr = 'test@server.com'
- toaddrs = 'test2@server.com'
- msg = 'Hello World'
- # provide user name and password
- username = 'login'
- password = 'password'
- # send an email with authentication
- server = smtplib.SMTP('smtp.server.com', 587)
- server.ehlo()
- server.starttls()
- server.ehlo()
- server.login(username, password)
- server.sendmail(fromaddr, toaddrs, msg)
- server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement