Git Product home page Git Product logo

emailsender's Introduction

Support forum EMailSender English
Forum supporto EMailSender italiano

Library to send EMail with attachments

Arduino (support W5100 like must be set, and ENC28J60 via UIPEthernet), esp8266 (SPIFFS, LittleFS and SD) (core <=2.4.2 must be set) and esp32 (SPIFFS, LITTLEFS, Ffat and SD), Arduino WiFiNINA SAMD devices (Arduino MKR WiFi 1010, Vidor 4000 UNO WiFi Rev.2 ecc.) (SD).

Complete english tutorial

Tutorial completo in italiano

Change log

12/04/2021: v2.4.1 Add support for LITTLEFS and Ffat on esp32 and fix certificate verification from esp32 core 1.0.5

18/03/2021: v2.3.0 Add support for LittleFS on esp8266

02/01/2021: v2.2.0 New support for SAMD devices via WiFiNINA (Arduino MKR WiFi 1010, Arduino Vidor 4000 and Arduino UNO WiFi Rev.2 ecc.).

01/01/2021: v2.1.5 Add possibility to use EHLO instead of HELO, and SASL login.

27/11/2020: v2.1.4 Add more constructor to allow more structure for distribution list (now const char*, char* and String array are supported)

23/11/2020: v2.1.3 Add management of name on EMail from

Installation Tutorial:

To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder EMailSender. Check that the EMailSender folder contains EMailSender\\.cpp and EMailSender.h. Place the EMailSender library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.

EMailSender library to send EMail.

With this library you can send email with attach: Arduino Network supported - w5100 like shield with Ethernet library - enc28J60 with UIPLibrary Storage support - SD

esp8266 you must pay attention, older core from 2.4.2 must be activated Storage supported - SD - SPIFFS - LittleFS

esp32 Storage supported - SD - SPIFFS - LITTLEFS - Ffat

Constructor: Default value is quite simple and use GMail as smtp server.

	EMailSender emailSend("[email protected]", "password");

If you want use onother provider you can use more complex (but simple) contructor

	EMailSender(const char* email_login, const char* email_password, const char* email_from, const char* smtp_server, uint16_t smtp_port);

You must connect to WIFI :P.

Create a message with the structure EMailMessage

    EMailSender::EMailMessage message;
    message.subject = "Subject";
    message.message = "Hi, How are you<br>Fine.";

Create array of attachments

// 		Two file
    EMailSender::FileDescriptior fileDescriptor[2];
    fileDescriptor[1].filename = F("test.txt");
    fileDescriptor[1].url = F("/test.txt");
    fileDescriptor[1].mime = MIME_TEXT_PLAIN;
    fileDescriptor[1].storageType = EMailSender::EMAIL_STORAGE_TYPE_SD;

    fileDescriptor[0].filename = F("logo.jpg");
    fileDescriptor[0].url = F("/logo.jpg");
    fileDescriptor[0].mime = "image/jpg";
    fileDescriptor[0].encode64 = true;
    fileDescriptor[0].storageType = EMailSender::EMAIL_STORAGE_TYPE_SD;

    EMailSender::Attachments attachs = {2, fileDescriptor};

Send message:

    EMailSender::Response resp = emailSend.send("[email protected]", message, attachs);

Then check the response:

    Serial.println("Sending status: ");
    Serial.println(resp.code);
    Serial.println(resp.desc);
    Serial.println(resp.status);

From version 2.1.1 new features distribution list to send CC and CCn email.

Example output:

Connection: ESTABLISHED
Got IP address: 192.168.1.104
Sending status: 
1
0
Message sent!

emailsender's People

Contributors

per1234 avatar xreef avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.