In this project, I will show you how to use Python Programming language to write a simple command line app for sending emails via Gmail!


Step 1: Download Python

Download Python 3.6.0 from here

https://www.python.org/downloads/



Step 2: Install Python & Add to Path

Open up the python installer you just download. Click install, but make sure to check the checkbox that say "Add Python to PATH" and "Install pip".


Step 3: Install SMTPLib

Open your computer's command prompt. In the command prompt, type in :

pip install smtplib

Then hit enter. It will install the library needed to connect Gmail to Python.




Step 4: Configure Gmail






 1. While logged into your Gmail at gmail.com, go to http://myaccount.google.com/security/
2. Scroll down to the part that say "Allow less secure apps".
3. Turn ON "allow less secure apps".


Step 5: Write and Run the Code



 Open the CMD and enter:

cd c:\users\raoadi\downloads

Hit enter, then type

py gmailpython.py

And hit enter again.