Advertisement
Guest User

Email Faker Python

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