Renzo Mischianti
Published © CC BY-NC-ND

How to Send Emails With Attachments With Arduino, Esp32 a...

Here I'd like to explain the version 2 of my library EMailSender, now allow attachments and support Arduino, esp32 and esp8266.

BeginnerFull instructions provided1 hour8,153
How to Send Emails With Attachments With Arduino, Esp32 a...

Things used in this project

Story

Read more

Schematics

Arduino and ethernet wiring

Arduino and ethernet and SD wiring

Code

Code snippet #4

Plain text
EMailSender::EMailMessage message;<br>    message.subject = "Soggetto";
    message.message = "Ciao come stai<br>io bene.<br>

    EMailSender::Response resp = emailSend.send("email_to_receive@gmail.com", message);

    Serial.println("Sending status: ");

    Serial.println(resp.status);
    Serial.println(resp.code);
    Serial.println(resp.desc);

Code snippet #5

Plain text
EMailSender::FileDescriptior fileDescriptor[1];<br>    fileDescriptor[0].filename = F("test.txt");
    fileDescriptor[0].url = F("/test.txt");
    fileDescriptor[0].mime = MIME_TEXT_PLAIN;
    fileDescriptor[0].encode64 = false;
    fileDescriptor[0].storageType = EMailSender::EMAIL_STORAGE_TYPE_SD;

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

    EMailSender::Response resp = emailSend.send("email_to_receive@gmail.com", message, attachs);

Github

https://github.com/xreef/EMailSender

Credits

Renzo Mischianti

Renzo Mischianti

35 projects • 43 followers
Software developer but I love electronics, wood, nature, and everything else as well. Now blogger? on www.mischianti.org

Comments