Integrating SMTP Server with Azure Databricks for Email Automation

Lorena Gongang
2 min readJul 10, 2023
Photo by Stephen Phillips - Hostreviews.co.uk on Unsplash

SMTP stand for Simple Mail Transfert Protocol(SMTP). It is an application mail servers use to send, receive and forward email messages. It acts as a bridge connecting senders and recipients.

This article explores the implementation of an automated email-sending solution using Python, SMTP and Databricks.

Setting up the SMTP Server and credentials

Before doing this, it is important to have the credentials. You need the SMTP server hostname, username, password and port. You need to contact the system admin to have that information.

Configuring Azure Databricks for SMTP

For this part, you first need to install Databricks CLI. After that, go to your terminal and set SMTP credentials. Doing this, you will add them to Databricks secrets. The main reason for this action is not having access (visible) to the credentials in the notebook. But to let them be secure and accessible via some commands.

The syntax is :

databricks secrets put --scope <scope-name> --key <key-name>

You have to set the parameters for each credential with the corresponding value. Each line has to be entered alone:

--

--

Lorena Gongang

Data Enthusiast | Data Engineer | Learning, sharing and building my online presence. Also write at https://lorenagongang.com/