Guest User

Untitled

a guest
Oct 30th, 2017
565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. import smtplib
  2. a = 1
  3. while a == 1:
  4. toaddrs = raw_input('Recipeints E-Mail:\n ')
  5. msg = raw_input('Type your message here:\n \n')
  6.  
  7. spam = int(raw_input('How many times would you like your message sent? (Beware lag) '))
  8.  
  9.  
  10. # Credentials (if needed)
  11. username = raw_input('\nWhat is your gmail username? \n(Include @gmail.com)\n')
  12. password = raw_input('What is your gmail password?\n')
  13.  
  14. spammer = spam - 1
  15. spamstr = str(spammer)
  16.  
  17.  
  18. # The actual mail send
  19. server = smtplib.SMTP('smtp.gmail.com:587')
  20. server.starttls()
  21. server.login(username,password)
  22. while spam > 0:
  23. server.sendmail(username + '@gmail.com', toaddrs, msg)
  24. print 'You have ' + spamstr + ' messages left to send.'
  25. spam = spam - 1
  26. spammer = spammer - 1
  27. spamstr = str(spammer)
  28. server.quit()
  29.  
  30. print 'Operation Complete!'
  31. close = raw_input('\n\n1: Exit \n2: New Recipeint\n\n')
  32. if close == "2":
  33. print('\n\n')
  34. else:
  35. break
Add Comment
Please, Sign In to add comment