Advertisement
Guest User

Untitled

a guest
Oct 28th, 2017
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. import email
  2. import smtplib
  3.  
  4. msg = email.message_from_string('warning')
  5. msg['From'] = "walidbenjehd@hotmail.com"
  6. msg['To'] = "saadyyousef@gmail.com"
  7. msg['Subject'] = "This is a test email"
  8.  
  9. s = smtplib.SMTP("smtp.live.com",587)
  10. s.ehlo() # Hostname to send for this command defaults to the fully qualified domain name of the local host.
  11. s.starttls() #Puts connection to SMTP server in TLS mode
  12. s.ehlo()
  13. s.login('walidbenjehd@hotmail.com', 'Ensahgfr0672517812')
  14.  
  15. s.sendmail("walidbenjehd@hotmail.com", "saadyyousef@gmail.com", msg.as_string())
  16.  
  17. s.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement