Today I’ll be demonstrating how to send email using python.

The only requirements are a Gmail account and Python 3.4.

1. Copy paste this into a .py file

Replace fromaddr with your email, toaddr with the recipient’s email, and enter your password for your gmail in “YOUR_PASSWORD_HERE”

import smtplib

fromaddr = "[email protected]"
toaddr = "[email protected]"

msg = "Hello this is an an automted script, please ignore"

server = smtplib.SMTP("")
server.login(fromaddr, "YOUR_PASSWORD_HERE")
server.sendmail(fromaddr, toaddr, msg)

2. By default Gmail wont let your program send email

So login and go to

And click “Turn on”

gmail allow

3. Run it

Run it from the command line