Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import smtplib
  2.  
  3. email_to = '*****@gmail.com'
  4. username = '*******@outlook.com'
  5. password = '*********'
  6. other_email = '*******@outlook.com'
  7.  
  8. mail = smtplib.SMTP('Outlook.com', 25)
  9. mail.ehlo()
  10. mail.starttls()
  11. mail.login(username,password)
  12.  
  13. header = ('To:' + email_to + 'n' +'From: ' + other_email + 'n'
  14. + 'Subject: Python Project Testn')
  15. message = (header +
  16. 'nn This is a test message generated from a Python script. nn')
  17.  
  18. mail.sendmail(username, email_to, message)
  19. mail.close()
  20. print("Email sent successfully.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement