Better Programming

Advice for programmers.

Member-only story

Creating Temporary Gmails Accounts With Python

3 min readJan 18, 2022

--

Image by author

Sometimes you come across a number of adverts and websites that you need to signup for but don’t completely trust. Temp mail is the most effective solution in this situation. These disposable email addresses replace your original ones and are expired after a certain time limit.

There are a number of online sites and services that help you make a temporary email address, however, in this tutorial, I am going to teach you how to create your own temporary Gmail addresses and receive emails at that address using Python.

Import Libraries

For this tutorial, we will be using only 2 python libraries That are re and request. If you don’t have them already installed, use the commands below to install them:

pip3 install request
pip3 install re

And then import them:

import request
import re

Generate Gmail

The very first step is to subscribe to the Temp-Gmail API via Rapid API (It’s totally free).

--

--

Amir Ali Hashemi
Amir Ali Hashemi

Written by Amir Ali Hashemi

I'm an AI student who attempts to find simple explanations for questions and share them with others