Fast, lightweight, and asynchronous email client library for Arduino.
Supports both SMTP and IMAP with full RFC compliance. Designed for 32-bit MCUs including ESP8266, ESP32, Teensy, Arduino MKR, SAMD, STM32, RP2040, and more.
ReadyMail is designed to be hardware-agnostic. It supports all filesystem types (e.g. SPIFFS, LittleFS, SD) and all network client libraries, including GSMClient, WiFiClient, EthernetClient, and PPP. This ensures seamless integration across diverse hardware and connectivity environments.
ReadyMail and click InstallAlternatively, install via ZIP file:
Download the latest release from:
https://github.com/mobizt/ReadyMail/releases
Then go to Sketch > Include Library > Add .ZIP Libraryβ¦
Add this to your platformio.ini:
lib_deps =
mobizt/ReadyMail@^0.4.1
β Supports ESP32, STM32, RP2040, SAMD, Renesas and more β except AVR
libraries/ReadyMail folderβ Not compatible with 8-bit AVR devices
ReadyMail adheres to key email protocol standards:
| Protocol | RFC | Description |
|---|---|---|
| SMTP | RFC 5321 | Simple Mail Transfer Protocol |
| IMAP | RFC 9051 | Internet Message Access Protocol v4rev2 |
| Message Format | RFC 822 | ARPA Internet Text Messages |
#include <Arduino.h>
#include <WiFi.h>
#include <WiFiClientSecure.h>
#define ENABLE_SMTP
#define ENABLE_DEBUG
#include <ReadyMail.h>
WiFiClientSecure ssl_client;
SMTPClient smtp(ssl_client);
void setup() {
Serial.begin(115200);
WiFi.begin("YOUR_SSID", "YOUR_PASSWORD");
while (WiFi.status() != WL_CONNECTED) delay(500);
ssl_client.setInsecure();
auto statusCallback = [](SMTPStatus status) {
Serial.println(status.text);
};
smtp.connect("smtp.example.com", 465, statusCallback);
if (smtp.isConnected()) {
smtp.authenticate("user@example.com", "password", readymail_auth_password);
SMTPMessage msg;
msg.headers.add(rfc822_from, "ReadyMail <user@example.com>");
msg.headers.add(rfc822_to, "Recipient <recipient@example.com>");
msg.headers.add(rfc822_subject, "Hello from ReadyMail");
msg.text.body("This is a plain text message.");
msg.html.body("<html><body><h1>Hello!</h1></body></html>");
configTime(0, 0, "pool.ntp.org");
while (time(nullptr) < 100000) delay(100);
msg.timestamp = time(nullptr);
smtp.send(msg);
}
}
void loop() {}
To ensure successful email delivery and avoid rejection or spam filtering by SMTP servers, follow these best practices:
msg.timestamp = time(nullptr);\r\n (CRLF) line breaks instead of \n (LF)configTime() or WiFi.getTime()#include <Arduino.h>
#include <WiFi.h>
#include <WiFiClientSecure.h>
#define ENABLE_IMAP
#define ENABLE_DEBUG
#include <ReadyMail.h>
WiFiClientSecure ssl_client;
IMAPClient imap(ssl_client);
void setup() {
Serial.begin(115200);
WiFi.begin("YOUR_SSID", "YOUR_PASSWORD");
while (WiFi.status() != WL_CONNECTED) delay(500);
ssl_client.setInsecure();
auto statusCallback = [](IMAPStatus status) {
Serial.println(status.text);
};
auto dataCallback = [](IMAPCallbackData data) {
if (data.event() == imap_data_event_fetch_envelope) {
for (int i = 0; i < data.headerCount(); i++) {
Serial.printf("%s: %s\n", data.getHeader(i).first.c_str(), data.getHeader(i).second.c_str());
}
}
};
imap.connect("imap.example.com", 993, statusCallback);
if (imap.isConnected()) {
imap.authenticate("user@example.com", "password", readymail_auth_password);
imap.select("INBOX");
imap.fetch(imap.getMailbox().msgCount, dataCallback);
}
}
void loop() {}
| Protocol | Port | Security | Notes |
|---|---|---|---|
| SMTP | 465 | SSL | Recommended |
| SMTP | 587 | STARTTLS | Requires upgrade-capable client |
| IMAP | 993 | SSL | Recommended |
| IMAP | 143 | STARTTLS | Requires upgrade-capable client |
See Connection Guide for client selection and port compatibility.
setBufferSizes()setPlainStart() in plain modeReadyMail.h from multiple .cpp files, you may get multiple definition linker errors for the global ReadyMail instance. To fix this, either:
-DREADYMAIL_NO_GLOBAL_INSTANCE as a compiler flag (recommended β applies to all files), or#define READYMAIL_NO_GLOBAL_INSTANCE before #include <ReadyMail.h> in every .cpp file that includes the header.Then create your own ReadyMailClass instance where needed.
See Troubleshooting Guide for detailed solutions and platform-specific workarounds.
Copyright Β© 2026 Suwatchai K (Mobizt).
k_suwatchai@hotmail.com with payment confirmation.See LICENSE for full terms.
For developers who need deeper control, debugging, or custom command support, see Advanced Usage for:
If you encounter crashes, SSL handshake failures, or unexpected behavior on ESP8266, ESP32, or Renesas boards, see the Troubleshooting Guide for:
To learn how to select the correct ports and SSL/network clients for your board, see the Connection Guide for: