· 8 years ago · Oct 31, 2017, 12:42 AM
1import smtplib
2a = 1
3while a == 1:
4 toaddrs = raw_input('Recipeints E-Mail:\n ')
5 msg = raw_input('Type your message here:\n \n')
6
7 spam = int(raw_input('How many times would you like your message sent? (Beware lag) '))
8
9
10 # Credentials (if needed)
11 username = raw_input('\nWhat is your gmail username? \n(Include @gmail.com)\n')
12 password = raw_input('What is your gmail password?\n')
13
14 spammer = spam - 1
15 spamstr = str(spammer)
16
17
18 # The actual mail send
19 server = smtplib.SMTP('smtp.gmail.com:587')
20 server.starttls()
21 server.login(username,password)
22 while spam > 0:
23 server.sendmail(username + '@gmail.com', toaddrs, msg)
24 print 'You have ' + spamstr + ' messages left to send.'
25 spam = spam - 1
26 spammer = spammer - 1
27 spamstr = str(spammer)
28 server.quit()
29
30 print 'Operation Complete!'
31 close = raw_input('\n\n1: Exit \n2: New Recipeint\n\n')
32 if close == "2":
33 print('\n\n')
34 else:
35 break