Skip to content

uPesy now ships to the entire European Union

Contents Menu Expand Light mode Dark mode Auto light/dark mode

Sending emails with your ESP32 and MicroPython

Did you know that with microPython, you can easily send emails to anyone from your ESP32? This is a handy feature to send weekly reports of your IoT project or to send an alarm when something critical happens:

  • The battery of the ESP32 board is low,

  • A mail has been detected in your mailbox

  • Detection of an unknown person

To do this, we will simulate a minimalist email client like Outlook, Gmail, or Mozilla Thunderbird.

Note

You will only be able to send emails but not receive them.

This is what the uPython library allows uMail , which works with any mailbox supporting the SMTP SMTP is a protocol that allows sending emails to a recipient . Since this library is very simplistic, it does not (yet) implement functions to send attachments. But it is always possible to tweak the raw data sent to add one.

In the end, not using the library will take the most time, but rather getting the correct information from your mailbox host: the famous SMTP ports and server address.

Note

I would use a Gmail and Outlook box for the example.

This article is available to premium members only. You still have 82% to discover.

Subscribe for only 5$/month

Already subscribed? Sign in

We use cookies to make your visit to the site as pleasant as possible. Privacy Policy