Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import email
- import smtplib
- msg = email.message_from_string('warning')
- msg['From'] = "walidbenjehd@hotmail.com"
- msg['To'] = "saadyyousef@gmail.com"
- msg['Subject'] = "This is a test email"
- s = smtplib.SMTP("smtp.live.com",587)
- s.ehlo() # Hostname to send for this command defaults to the fully qualified domain name of the local host.
- s.starttls() #Puts connection to SMTP server in TLS mode
- s.ehlo()
- s.login('walidbenjehd@hotmail.com', 'Ensahgfr0672517812')
- s.sendmail("walidbenjehd@hotmail.com", "saadyyousef@gmail.com", msg.as_string())
- s.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement