Python 3 Gmail API Example to Fetch Recently Sent Emails Using Imaplib Library Full Project For Beginners

You are currently viewing Python 3 Gmail API Example to Fetch Recently Sent Emails Using Imaplib Library Full Project For Beginners

 

Welcome folks today in this example we will be fetching recently sent emails in gmail using python and imaplib library. All the full source code of the application is given below.

 

 

Get Started

 

 

In order to get started you need to install the following library using the pip command as shown below

 

pip install imaplib

 

Now you need to enable some settings inside your gmail account to enable imap protocol to fetch recently sent emails

 

Go to Imap Settings

 

 

 

Just grant the imap access inside your gmail account as shown above in the picture

 

After this make an app.py file and copy paste the following code

 

app.py

 

 

 

Here you need to replace the username and password of your gmail account and then run the python script by typing the below command

 

python app.py

 

Now after running this script it will list all your recent sent emails of your gmail account

Leave a Reply