Guest User

Untitled

a guest
Aug 19th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import smtplib
  2. import email.utils
  3. from email.mime.text import MIMEText
  4.  
  5. smtpserver = smtplib.SMTP("smtp.gmail.com",587)
  6. smtpserver.ehlo()
  7. smtpserver.starttls()
  8. smtpserver.ehlo()
  9. smtpserver.login('username@gmail.com', 'pwd')
  10. msg['Subject'] = "subject line"
  11. msg['From'] = 'newusername@gmail.com'
  12. msg['To'] = 'friend@gmail.com'
  13. smtpserver.sendmail(sender, recipients, msg.as_string())
Add Comment
Please, Sign In to add comment