Thursday, July 7, 2016

Sending Mail via Gmail using Python Script

Today i will explain you how to send mail using python script.

Now first we need one gmail account through which we will be sending mail to anyone else.

Also you have to enable to lesssecureapps option for the gmail account, because google will not

allow you to send mail using any script. So we will go to the below link and enable it.

https://www.google.com/settings/security/lesssecureapps

I am using Smtp server (gmail) and the specific port for sending mail.

Also you need to have smtplib modules , which you can get it from python library.

Find the piece of code to do so.



To make it funny i have added a for loop to send the same mail 100 times.

You can remove that.

Please comment in case of any doubt


No comments:

Post a Comment