Ben Chuanlong Du's Blog

It is never too late to learn.

Send Emails in Python

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Use Standard Libraries smtplib and email

Below is a function for sending email leveraging standard libraries smtplib and email.

import smtplib
from email.mime.text import MIMEText


def send_email(recipient: Union …