SkillAgentSearch skills...

EMailSender

Arduino, esp32, Esp8266 EMailSender with Arduino IDE, simple library to send email via smtp with attachments.

Install / Use

/learn @xreef/EMailSender

README

EMailSender Library v4.1.3

EMailSender Logo

arduino-library-badge

A comprehensive Arduino library for sending emails via SMTP with full support for attachments, multiple recipients, and secure connections (SSL/TLS and STARTTLS).

Author: Renzo Mischianti
Website: www.mischianti.org
GitHub: @xreef


📚 Documentation & Tutorials

Complete tutorials and articles available on mischianti.org:

General Documentation

Platform-Specific Guides

ESP32 & ESP8266 Tutorials

Arduino Tutorials

STM32 Tutorials

Raspberry Pi Pico (RP2040) Tutorials

Advanced Topics


📋 Table of Contents

✨ Features

Core Features

  • Send emails via SMTP with authentication
  • Multiple recipients (To, Cc, Bcc)
  • HTML and plain text email formats
  • File attachments from various storage systems
  • Base64 encoding for attachments
  • Custom sender name and email address
  • Subject and message body customization

Security Features (NEW in v4.0.0)

  • STARTTLS support (Port 587) - NEW!
  • Implicit SSL/TLS (Port 465)
  • Multiple authentication methods:
    • AUTH LOGIN (default)
    • AUTH PLAIN (SASL)
    • CRAM-MD5 (ESP32 only)
  • Internal SSLClient for STARTTLS on ESP32/ESP8266
  • OpenSLab SSLClient (BearSSL) for Ethernet shields

Network Support

  • Multiple network interfaces (WiFi, Ethernet, WiFiNINA)
  • Automatic IP resolution
  • Connection retry logic
  • Flexible client configuration

🎯 Supported Platforms

| Platform | WiFi | Ethernet | SSL/TLS | STARTTLS | |----------|------|----------|---------|----------| | ESP32 | ✅ | ✅ | ✅ | ✅ | | ESP8266 | ✅ | ✅ | ✅ | ✅ | | Arduino Mega/Uno | ❌ | ✅ | ❌ | ❌ | | Arduino SAMD | ✅ | ✅ | ✅ | ✅ | | STM32 | ❌ | ✅ | ✅ | ✅ | | Raspberry Pi Pico (RP2040) | ✅ | ✅ | ✅ | ✅ |

⚠️ IMPORTANTE - Arduino Mega/Uno e SSL/TLS:

Arduino Mega and Uno DO NOT support SSL/TLS due to severe RAM limitations:

  • Arduino Mega has only 8KB of RAM
  • Arduino Uno has only 2KB of RAM
  • BearSSL for SSL/TLS requires at least 24KB of RAM for encryption buffers

Alternative solutions for Arduino Mega/Uno:

  1. Use non-secure SMTP (port 25) - Works but not recommended
  2. Use a local SMTP relay - Configure a local server that handles SSL
  3. Switch to ESP32/ESP8266 - They have more RAM and native SSL/TLS support
  4. Use Arduino SAMD (MKR WiFi 1010) - Has 32KB RAM and supports SSL/TLS

Arduino Mega/Uno examples in this library use only non-secure SMTP!

🌐 Supported Network Interfaces

  • WiFi (ESP32/ESP8266) - WiFiClient / WiFiClientSecure
  • WiFi (SAMD/MBED) - WiFiNINA library
  • Ethernet W5100/W5200/W5500 - Standard Ethernet library
  • Ethernet ENC28J60 - UIPEthernet library
  • Ethernet with SSL - SSLClient wrapper for secure connections

💾 Supported Storage Systems

Internal Storage (Microcontroller Flash)

  • SPIFFS (ESP32, ESP8266)
  • LittleFS (ESP32, ESP8266, RP2040)
  • FFAT (ESP32)
  • SPIFM (SPI Flash with Adafruit_SPIFlash)
  • Generic stream and string attachments option

External Storage (SD/microSD Cards)

  • SD (Standard SD library)
  • SdFat (Version 1.x for RP2040/ESP8266)
  • SdFat2 (Version 2.x for modern platforms)

📦 Installation

Arduino IDE

  1. Open Arduino IDE
  2. Go to Sketch > Include Library > Manage Libraries
  3. Search for "EMailSender"
  4. Click Install

PlatformIO

Add to your platformio.ini:

lib_deps = 
    xreef/EMailSender@^4.1.3

Manual Installation

  1. Download the library from GitHub
  2. Extract to Arduino libraries folder
  3. Restart Arduino IDE

🚀 Basic Usage

Simple Email (ESP32 with Gmail)

#include <WiFi.h>
#include <EMailSender.h>

const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASSWORD";

// Gmail SMTP configuration
EMailSender emailSend("your.email@gmail.com", 
                      "your_app_password",
                      "your.email@gmail.com", 
                      "Your Name",
                      "smtp.gmail.com", 
                      587);  // Port 587 for STARTTLS

void
View on GitHub
GitHub Stars81
CategoryDevelopment
Updated2mo ago
Forks31

Languages

C++

Security Score

100/100

Audited on Jan 21, 2026

No findings