Advertisement
Guest User

Untitled

a guest
Jun 16th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. #The only way to fail is to quit
  2. #The asteroid to kill this dinosaur is still in orbit
  3. #THERE are ALWAYS to WAYS wrong or right :) [like capital A and small a (its upto to you where u go when to go how to go not on other u choose not others u pay not others ] always keep smiling GOOD for health
  4. #Ball is in always your coat you dont know how play with it
  5. import sys
  6. import smtplib
  7. username = sys.argv[1]
  8. password = sys.argv[2]
  9. to = sys.argv[4]
  10. n = sys.argv[5]
  11. msg = sys.argv[6]
  12. try:
  13.     server = smtplib.SMTP('smtp.gmail.com')
  14.     server.ehlo()
  15.     server.starttls()
  16.     server.login(username,password)
  17. except:
  18.     print("Error: Unable to connect")
  19.     sys.exit(100)
  20.  
  21. for i in range(int(n)):
  22.     try:
  23.         server.sendmail(username,to,msg)
  24.     except:
  25.         print("Error: Unable to send mail")
  26.         sys.exit(100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement