add lt and gt signs is missing (#18064)

This commit is contained in:
Barbudor 2023-02-27 16:33:31 +01:00 committed by GitHub
parent 635afa36de
commit 39fd0cb0c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -22,6 +22,8 @@
* #define EMAIL_SERVER "smtp.gmail.com"
* #define EMAIL_PORT 465
*
* Note : starting with this update, it is not required anymore to include emails in < > as they will
* be automatically added if needed
* if email body consist of a single * and scripter is present
* and a section >m is found, the lines in this section (until #) are sent as email body
*
@ -111,7 +113,7 @@ String SendEmail::readClient() {
return r;
}
bool SendEmail::send(const String& from, const String& to, const String& subject, const char *msg) {
bool SendEmail::send(const String& _from, const String& _to, const String& subject, const char *msg) {
if (!host.length()) { return false; }
client->setTimeout(timeout);
@ -129,6 +131,10 @@ bool SendEmail::send(const String& from, const String& to, const String& subject
return false;
}
String from, to;
from = ('<' == *_from.c_str()) ? _from : ("<" + _from + ">");
to = ('<' == *_to.c_str()) ? _to : ("<" + _to +">");
String buffer = readClient();
#ifdef DEBUG_EMAIL_PORT
MailReadAddLogBuffer(&buffer);