Advertisement
Guest User

cymail.py

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