Python 3 Script to Send PDF File Through Email Using pdf-mail Library Full Project For Beginners

You are currently viewing Python 3 Script to Send PDF File Through Email Using pdf-mail Library Full Project For Beginners

 

 

 

Welcome folks today in this blog post we will be sending pdf file though email using pdf-mail library. The source code of this tutorial will be given below.

 

 

Get Started

 

 

In order to get started you need to install pdf-mail library using the pip command

 

pip install pdf-mail

 

Now we want to create app.py file and copy paste the following code

 

 

app.py

 

 

 

 

 

Now in this python script we need to replace the appropriate values

 

sender's email address

receiver's email address

sender's password

body of mail

subject of mail

filename

filepath

Before executing this script you need to turn on secure apps access for your gmail account to send emails on your behalf account.

 

 

 

 

 

 

Now if you execute this python script app.py you will see following result

 

 

 

 

Now you can see the email address received in which the pdf file is there.

 

 

Leave a Reply