daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 285 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import smtplib
  2. from email.mime.text import MIMEText
  3.  
  4. USERNAME = "username@gmail.com"
  5. PASSWORD = "password"
  6. MAILTO  = "mailto@gmail.com"
  7.  
  8. msg = MIMEText('This is the body of the email')
  9. msg['Subject'] = 'The email subject'
  10. msg['From'] = USERNAME
  11. msg['To'] = MAILTO
  12.  
  13. server = smtplib.SMTP('smtp.gmail.com:587')
  14. server.ehlo_or_helo_if_needed()
  15. server.starttls()
  16. server.ehlo_or_helo_if_needed()
  17. server.login(USERNAME,PASSWORD)
  18. server.sendmail(USERNAME, MAILTO, msg.as_string())
  19. server.quit()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top