Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 Test\n')
- message = (header +
- '\n\n This is a test message generated from a Python script. \n\n')
- mail.sendmail(username, email_to, message)
- mail.close()
- print("Email sent successfully.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement