(Updated at 12/01/2022)
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.
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.
I would use a Gmail and Outlook box for the example.