Advertisement
Guest User

Untitled

a guest
Apr 6th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. # Python 2.7
  2. # For educational purposes only!!!
  3. # Username = Your email account
  4. # Password = Your email password :)
  5.  
  6. import os
  7. import smtplib
  8. import getpass
  9. import sys
  10.  
  11.  
  12. print ("""
  13. \n
  14. ###### ## ## ######## ## ## ####### ########
  15. ## ## ## ## ## ## ## ## ## ## ## ##
  16. ## #### ## ## ## ## ## ## ##
  17. ## ## ######## ######### ####### ########
  18. ## ## ## ## ## ## ## ##
  19. ## ## ## ## ## ## ## ## ## ##
  20. ###### ## ## ## ## ####### ## ##
  21. \n
  22. ----------------------- Syndicate -----------------------
  23.  
  24. """)
  25. print'\n'
  26.  
  27. server = raw_input('Server Mail: ')
  28. user = raw_input('Username: ')
  29. passwd = getpass.getpass('Password: ')
  30.  
  31.  
  32. to = raw_input('\nTo: ')
  33. # subject = raw_input('Subject: ')
  34. body = raw_input('Message: ')
  35. total = input('Number of send: ')
  36.  
  37. if server == 'gmail':
  38. smtp_server = 'smtp.gmail.com'
  39. port = 587
  40. elif server == 'yahoo':
  41. smtp_server = 'smtp.mail.yahoo.com'
  42. port = 25
  43.  
  44. else:
  45. print 'Applies to gmail and yahoo only.'
  46. sys.exit()
  47.  
  48. print ''
  49.  
  50. try:
  51. server = smtplib.SMTP(smtp_server,port)
  52. server.ehlo()
  53. if smtp_server == 'smtp.gmail.com':
  54. server.starttls()
  55. server.login(user,passwd)
  56. for i in range(1, total+1):
  57. subject = os.urandom(9)
  58. msg = 'From: ' + user + '\nSubject: ' + subject + '\n' + body
  59. server.sendmail(user,to,msg)
  60. print "\rTotal emails sent: %i" % i
  61. sys.stdout.flush()
  62. server.quit()
  63. print '\nDone !!!'
  64. except KeyboardInterrupt:
  65. print '[-] Canceled'
  66. sys.exit()
  67. except smtplib.SMTPAuthenticationError:
  68. print '\n[!] The username or password you entered is incorrect.'
  69. sys.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement