Advertisement
Guest User

Untitled

a guest
Mar 30th, 2011
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. import smtplib
  2.  
  3. username = raw_input('Whats your email address?\n')
  4. password = raw_input('Whats your password?\n')
  5. toaddrs  = raw_input('Send to...\n')
  6. msg = raw_input('Type your message:\n')
  7. # The actual mail send
  8. if "gmail" in username:
  9.     server = smtplib.SMTP('smtp.gmail.com')
  10. elif "hotmail" or "msn"in username:
  11.     server = smtplib.SMTP('smtp.live.com:587')
  12. elif "yahoo" in username:
  13.     server = smtplib.SMTP('smtp.mail.yahoo.com:25')
  14. else:
  15.     print "I'm sorry, Your email provider isn't currently supported."      
  16. server.starttls()
  17. server.login(username,password)
  18. server.sendmail(username, toaddrs, msg)
  19. print 'Done!'
  20.  
  21.    
  22. raw_input("Press enter to continue.")
  23. server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement