· 9 years ago · Aug 10, 2017, 09:06 PM
1import smtplib
2
3toaddrs = raw_input('Who do you want to send this to? ')
4msg = raw_input('Type your message here:\n \n ')
5
6spam = int(raw_input('How many times would you like your message sent? (Beware lag) '))
7
8
9# Credentials (if needed)
10username = raw_input('\nWhat is your gmail username? ')
11password = raw_input('What is your gmail password? ')
12
13spammer = spam - 1
14spamstr = str(spammer)
15
16
17# The actual mail send
18server = smtplib.SMTP('smtp.gmail.com:587')
19server.starttls()
20server.login(username,password)
21while spam > 0:
22 server.sendmail(username + '@gmail.com', toaddrs, msg)
23 print 'You have ' + spamstr + ' messages left to send.'
24 spam = spam - 1
25 spammer = spammer - 1
26 spamstr = str(spammer)
27server.quit()
28
29print 'Operation Complete!'
30input('Press enter to exit...')