Advertisement
Guest User

Gmail

a guest
Jun 4th, 2018
36,756
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.10 KB | None | 0 0
  1.  
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. import smtplib
  54. import time
  55.  
  56. sent=0
  57. chooise=raw_input("Would you like to more send? y/n: ")
  58.  
  59. if chooise=="y":
  60.            username=raw_input("you gmail username: ")
  61.            password=raw_input("you gmail password: ")
  62.            print ("Connecting to server please wait...")
  63.            smtpserver=smtplib.SMTP("smtp.gmail.com",587)
  64.            smtpserver.ehlo()
  65.            smtpserver.starttls()
  66.            smtpserver.ehlo
  67.            smtpserver.login(username,password)
  68.            print("Connection succesfull")
  69.            print('press enter to stop')
  70.            elist=[]
  71.            while True:
  72.              targetxxx=raw_input('Target email: ')
  73.              if len(targetxxx)==0:break
  74.              elist.append(targetxxx)
  75.              more_sent=input('how many emails to send: ')
  76.              message=raw_input('youre messeage to target:')
  77.            while sent <=more_sent:
  78.              for targetxxx in elist:
  79.                  smtpserver.sendmail(username,targetxxx,message)
  80.                  print ("Sending emails")
  81.                  sent+=1
  82.                  print ("succesfull send")
  83.  
  84. elif chooise=="n":
  85.  
  86.          username=raw_input("your gmail username: ")
  87.          password=raw_input("your password: ")
  88.          smtpserver=smtplib.SMTP("smtp.gmail.com",587)
  89.          smtpserver.ehlo()
  90.          smtpserver.starttls()
  91.          smtpserver.ehlo
  92.          smtpserver.login(username,password)
  93.          print("Connect to server succesfull")
  94.          targetxxx=raw_input("enter target E-mail: ")
  95.          message=raw_input("Please enter a message: ")
  96.          more_Sent=input("How many messages to send?: ")
  97.          for i in xrange(more_Sent + 1):
  98.              smtpserver.sendmail(username,targetxxx,message)
  99.          print "Sent to %s %d emails." % (targetxxx,more_Sent)
  100.          send= more_Sent + 1
  101.          print "was sent succesfull"
  102.          time.sleep(1)
  103. else:
  104.          print "Please choose y or n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement