diff --git a/EMailSender.cpp b/EMailSender.cpp index e1a7cb6..dc8159e 100644 --- a/EMailSender.cpp +++ b/EMailSender.cpp @@ -2,7 +2,7 @@ * EMail Sender Arduino, esp8266, stm32 and esp32 library to send email * * AUTHOR: Renzo Mischianti - * VERSION: 3.0.4 + * VERSION: 3.0.5 * * https://www.mischianti.org/ * @@ -522,14 +522,15 @@ EMailSender::Response EMailSender::send(const char* to[], byte sizeOfTo, byte s } if (this->additionalResponseLineOnConnection > 0){ - for (int i = 0; i<=this->additionalResponseLineOnConnection; i++) awaitSMTPResponse(client); + for (int i = 0; i<=this->additionalResponseLineOnConnection; i++) { response = awaitSMTPResponse(client, "220", "Connection response error ", 2500); if (!response.status && response.code == F("1")) { response.desc = F("Connection error! Reduce the HELO response line!"); + client.flush(); + client.stop(); + return response; } - client.flush(); - client.stop(); - return response; + } } String commandHELO = "HELO"; @@ -565,13 +566,13 @@ EMailSender::Response EMailSender::send(const char* to[], byte sizeOfTo, byte s if (this->additionalResponseLineOnHELO > 0){ for (int i = 0; i<=this->additionalResponseLineOnHELO; i++) { - response = awaitSMTPResponse(client, "250", "EHLO error", 2500); - if (!response.status && response.code == F("1")) { - response.desc = F("Timeout! Reduce the HELO response line!"); - } + response = awaitSMTPResponse(client, "250", "EHLO error", 2500); + if (!response.status && response.code == F("1")) { + response.desc = F("Timeout! Reduce the HELO response line!"); client.flush(); client.stop(); return response; + } } } diff --git a/EMailSender.h b/EMailSender.h index 798d4b4..7ec20a7 100644 --- a/EMailSender.h +++ b/EMailSender.h @@ -2,7 +2,7 @@ * EMail Sender Arduino, esp8266, stm32 and esp32 library to send email * * AUTHOR: Renzo Mischianti - * VERSION: 3.0.4 + * VERSION: 3.0.5 * * https://www.mischianti.org/ * diff --git a/EMailSenderKey.h b/EMailSenderKey.h index 40a887a..92361b7 100644 --- a/EMailSenderKey.h +++ b/EMailSenderKey.h @@ -2,7 +2,7 @@ * EMail Sender Arduino, esp8266, stm32 and esp32 library to send email * * AUTHOR: Renzo Mischianti - * VERSION: 3.0.4 + * VERSION: 3.0.5 * * https://www.mischianti.org/ * diff --git a/README.md b/README.md index 8ee84c3..acde63a 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Arduino (support W5100 like must be set, and ENC28J60 via UIPEthernet), esp8266 #### [Inviare email con allegati (libreria v2.x): esp32 e esp8266](https://www.mischianti.org/it/2020/06/16/inviare-email-con-allegati-libreria-v2-x-esp32-e-esp8266-part-2/) ## Change log + - 19/07/2022: v3.0.5 Additional fix on additional response management ([#26](https://github.com/xreef/EMailSender/issues/26)) - 12/07/2022: v3.0.4 Fixed attachment issue on SPIFFS and LittleFS - 06/07/2022: v3.0.3 Manage multiple response message after connect and HELO ([#26](https://github.com/xreef/EMailSender/issues/26)) - 03/06/2022: v3.0.2 Add possibility to set additionalResponseLineOnConnection with void setAdditionalResponseLineOnConnection(uint8_t numLines = 0), needed if on connection you receive 220 response as error, and add Ethernet2. diff --git a/library.json b/library.json index 5a35604..2c507cf 100644 --- a/library.json +++ b/library.json @@ -16,6 +16,6 @@ }, "url": "https://www.mischianti.org", "frameworks": "Arduino", - "version": "3.0.4", + "version": "3.0.5", "platforms": "*" } diff --git a/library.properties b/library.properties index a71803c..90ecee9 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=EMailSender -version=3.0.4 +version=3.0.5 author=Renzo Mischianti maintainer=Renzo Mischianti sentence=Send EMail via SMTP, library for Arduino, SAMD (WiFiNINA), STM32, esp8266 and esp32.