Advertisement
Guest User

Untitled

a guest
Sep 25th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. mys-office-laptop
  2. import os
  3. from slackclient import SlackClient
  4. import smtplib
  5.  
  6. gmail_user = 'testing@.com'
  7. gmail_password = ''
  8. sent_from = gmail_user
  9. to = ['may@.com']
  10. subject = 'OMG Super Important Message'
  11.  
  12. try:
  13. server = smtplib.SMTP('smtp.gmail.com', 587)
  14. server.ehlo()
  15. server.starttls()
  16. server.ehlo()
  17. server.login(gmail_user, gmail_password)
  18. server.sendmail(sent_from, to, subject)
  19. server.quit()
  20. except Exception, e:
  21. print 'Something went wrong...', e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement