(Updated at 01/03/2023)
Sending automatic emails from ESP32 is possible!
This is very useful for sending daily or weekly reports of the values measured by your sensors or for sending an alarm when an unusual event occurs. For example:
The battery of the ESP32 board is low.
A mail has been detected in your mailbox
Detection of an unknown person
We are going to simulate a minimalist mail client like Outlook, Gmail, or Mozilla Thunderbird using the Arduino library
ESP-Mail-Client from mobizt
The library allows you to send emails and read those received in your inbox. You can even send attachments stored in the flash memory of the ESP32.
In our case, it is mainly to send emails that it is interesting. The library works with any mailbox supporting the protocol
SMTP SMTP is a protocol for sending mail to a recipient .
I would use a Gmail and Outlook box for the example.
It is installed like any other Arduino library. It is available in the Arduino IDE’s library manager (located in Tools → Manage libraries ) :