Do you know what most office jobs have in common? In most of them, you have to send emails regularly.
It doesn’t matter if you’re a programmer, data scientist, or engineer, chances are you have to read and respond to emails on a daily basis. This activity doesn’t add any value to our professions, yet it stops our workflow and takes our valuable time.
The solution? Automate it with Python!
In this guide, I’ll show you how to automate sending emails with Python. We’ll be using Gmail in this tutorial, so make sure you have a Gmail account to test out this automation.
1. Turn On 2-Step Verification
Before we start writing code, we need to set up our Gmail account to be able to use it with Python.
In the past, we could easily connect to Gmail with Python by turning on “Less secure app access” but that option isn’t available anymore. What we have to do now is turn on 2-step verification to get a 16-character password that we can use to log in to Gmail using Python.
First, go to your Google account…

