Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import smtplib
- email_to = '*****@gmail.com'
- username = '*******@outlook.com'
- password = '*********'
- other_email = '*******@outlook.com'
- mail = smtplib.SMTP('Outlook.com', 25)
- mail.ehlo()
- mail.starttls()
- mail.login(username,password)
- header = ('To:' + email_to + 'n' +'From: ' + other_email + 'n'
- + 'Subject: Python Project Testn')
- message = (header +
- 'nn This is a test message generated from a Python script. nn')
- mail.sendmail(username, email_to, message)
- mail.close()
- print("Email sent successfully.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement