AdBlock Detected

We provide high-quality source code for free. Please consider disabling your AdBlocker to support our work.

Buy me a Coffee

Saved Tutorials

No saved posts yet.

Press Enter to see all results

How to Send Automatic Emails using Python

By pushpam abhishek
Listen to this article

How to Send Automatic Emails using Python

In these tutorials, How to Send Automatic Emails using Python. Once thing You need to figure out is what you want to send automatically.

How to Send Automatic Emails using Python

Now, in this Section, we will take you through how to send automatic emails using Python.

 Generate a Google app Password

For this task, you must first generate a google app password for your Gmail account. If you don’t know how to generate it, you can learn more from the video below.


Python Send Email Using Gmail

It is very important to generate a Google app password for your Gmail account, as you will be sending automatic emails using Python through your Gmail account.

Here How can start sending mail using your Gmail account. Source Code below.

import os
import random
import smtplib


def automatic_email():
    user = input("Enter Your Name >>: ")
    email = input("Enter Your Email >>: ")
    message = (f"Dear {user}, Welcome to Trickcode.in")
    s = smtplib.SMTP('smtp.gmail.com', 587)
    s.starttls()
    s.login("pushpambhshk@gmail.com", "nkwfnltkribxjhec")
    s.sendmail('&&&&&&&&&&&', email, message)
    print("Email Sent!")
    
automatic_email()

You will see the output as shown below

Python Send Email Using Gmail

Video :

Share this post

pushpam abhishek

About pushpam abhishek

Pushpam Abhishek is a Software & web developer and designer who specializes in back-end as well as front-end development. If you'd like to connect with him, follow him on Twitter as @pushpambhshk

Comments