xreef / EMailSender

Arduino, esp32, Esp8266 EMailSender with Arduino IDE, simple library to send email via smtp with attachments.
https://www.mischianti.org/category/my-libraries/emailsender-send-email-with-attachments/
MIT License
74 stars 26 forks source link

Gmail with attachments always times out. #41

Closed davidgs closed 1 year ago

davidgs commented 1 year ago

All attempts to send any attachments results in

ONLY ONE RECIPIENT
multiple destination and attachments
Insecure client:0
smtp.gmail.com
465
[ 14169][D][ssl_client.cpp:176] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
220 smtp.gmail.com ESMTP w4-20020a056871060400b001b04277bbb3sm3204250oan.47 - gsmtp

HELO mischianti 
250 smtp.gmail.com at your service

AUTH LOGIN:
334 VXNlcm5hbWU6

Encoding
davidgs@xxx.com
20
ZGF2aWRnc0BvdHRlcml6ZS5jb20=
Encoding
davidgs@xxx.com
20
334 UGFzc3dvcmQ6

Encoding
****************
334 UGFzc3dvcmQ6

235 2.7.0 Accepted

MAIL FROM: <>
[ 16253][E][ssl_client.cpp:37] _handle_error(): [send_ssl_data():382]: (-80) UNKNOWN ERROR CODE (0050)
RCPT TO: <davidgs@me.com>
DATA:
Sending status: 
0
1
SMTP DATA error! SMTP Response TIMEOUT!

abort() was called at PC 0x4018b7f6 on core 1

The board crashes and restarts.

Any ideas? The file I'm trying to send is only 48 bytes.

The sending function:


int sendEmail(fs::FS &fs, const char * path){
  File dir = SPIFFS.open("/");
    File file = dir.openNextFile();
    while (file) {
        Serial.println(file.name());
        Serial.println(file.size());

        file = dir.openNextFile();
    }
  EMailSender::EMailMessage message;
    message.subject = "New Picture!";
    message.message = "Your WiFi ESP32 Cam has sent a new picture! Enjoy!";
    EMailSender::FileDescriptior fileDescriptor[1];
    fileDescriptor[0].filename = F("msg.txt");
    fileDescriptor[0].url = F("/msg.txt");
    fileDescriptor[0].mime = "text/plain";
    fileDescriptor[0].encode64 = false;
    fileDescriptor[0].storageType = EMailSender::EMAIL_STORAGE_TYPE_SPIFFS;

    EMailSender::Attachments attachs = {1, fileDescriptor};
    EMailSender::Response resp = emailSend.send(sett.receiver_email, message, attachs);
    Serial.println("Sending status: ");
    Serial.println(resp.status);
    Serial.println(resp.code);
    Serial.println(resp.desc);
}
xreef commented 1 year ago

Hi David, please add board, configuration and network. Bye RM

davidgs commented 1 year ago

Board: ESP32-CAM AI Thinker Network: WiFi (simple email works, it's just the attachment that fails) Flash Mode: QIO Partition Scheme: No OTA 2MB APP / 2MB Flash

xreef commented 1 year ago

Sorry for the late response, I try it, and It works. Check your network firewall or something similar. Bye Renzo