CopyRight

If you feel that any content has violated the copy-Right law please be free to mail me.
I will take suitable action.
Thanks

Sunday 12 January 2014

Email -Spammer in Python

#Writing an Email Spammer in Python

#First, Importing the Simple Mail Transfer Protocol Module

import smtplib

#Specifying the From and To addresses

fromaddress = "fromaddress@gmail.com"
toaddress = "toaddress@gmail.com"

#Now,Specifying the Gmail Login

username = "yourgmail username"
password = "yourgmail password"

#Writing the message which will appear in the mail

message = """From:CodeScripter
...text here...
"""

#Creating a connection with the Gmail server

server =smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)

#Creating a for loop to send multiple mails

for i in range (0,10):
server.sendmail(fromaddress,toaddress,message)
print "mail sent"

#closing the server
server.quit()