Advertisement
Guest User

Untitled

a guest
Aug 9th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import time
  4. import smtplib
  5.  
  6. print '*------------The Shabba Spammer------------*'
  7.  
  8. sendaddrs = (raw_input('Send to: '))
  9. msg = (raw_input('Message: '))
  10. num = int(raw_input('How many times to send [No more than 50] : '))
  11.  
  12. #login details
  13. username = (raw_input('GMAIL Username: '))
  14. pword = (raw_input('GMAIL Password: '))
  15.  
  16. #mail sending (smtp connection)
  17.  
  18. domserver = smtplib.SMTP('smtp.gmail.com:587')
  19. domserver.starttls()
  20. domserver.login(username, pword)
  21.  
  22. x = (raw_input('Send message? [May take a few moments if multiple messages] [y/n]  '))
  23. if x =='y':
  24.     print "Sending emails..."
  25.     for i in range(num):
  26.         domserver.sendmail(username, sendaddrs, msg)
  27.     domserver.quit()
  28.     print 'Message sent'
  29.     time.sleep(3)
  30.    
  31.  
  32. elif x =='n':
  33.     print 'Action cancelled'
  34.     domserver.quit()
  35.    
  36.  
  37. else:
  38.     print 'Invalid decision'
  39.     domserver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement