Skip to content

Commit

Permalink
Additional fix on additional response management ([#26](#26))
Browse files Browse the repository at this point in the history
  • Loading branch information
xreef committed Jul 20, 2022
1 parent 5ada6f7 commit 6afd5ab
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
19 changes: 10 additions & 9 deletions EMailSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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/
*
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion EMailSender.h
Original file line number Diff line number Diff line change
Expand Up @@ -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/
*
Expand Down
2 changes: 1 addition & 1 deletion EMailSenderKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -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/
*
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
},
"url": "https://www.mischianti.org",
"frameworks": "Arduino",
"version": "3.0.4",
"version": "3.0.5",
"platforms": "*"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=EMailSender
version=3.0.4
version=3.0.5
author=Renzo Mischianti <[email protected]>
maintainer=Renzo Mischianti <[email protected]>
sentence=Send EMail via SMTP, library for Arduino, SAMD (WiFiNINA), STM32, esp8266 and esp32.
Expand Down

0 comments on commit 6afd5ab

Please sign in to comment.