Merge pull request #9940 from vic42/prepare_pr

corrected a mixup of MIME multipart and simple plain text email messages
This commit is contained in:
Theo Arends 2020-11-22 09:47:35 +01:00 committed by GitHub
commit 94166e1dd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -331,11 +331,6 @@ String buffer;
goto exit; goto exit;
} }
buffer = F("MIME-Version: 1.0\r\n");
client->print(buffer);
buffer = F("Content-Type: Multipart/mixed; boundary=frontier\r\n");
client->print(buffer);
buffer = F("From: "); buffer = F("From: ");
buffer += from; buffer += from;
client->println(buffer); client->println(buffer);
@ -350,22 +345,27 @@ String buffer;
#endif #endif
buffer = F("Subject: "); buffer = F("Subject: ");
buffer += subject; buffer += subject;
buffer += F("\r\n");
client->println(buffer); client->println(buffer);
#ifdef DEBUG_EMAIL_PORT #ifdef DEBUG_EMAIL_PORT
AddLog_P(LOG_LEVEL_INFO, PSTR("%s"),buffer.c_str()); AddLog_P(LOG_LEVEL_INFO, PSTR("%s"),buffer.c_str());
#endif #endif
#ifdef USE_SCRIPT #ifdef USE_SCRIPT
if (*msg=='*' && *(msg+1)==0) { if (*msg=='*' && *(msg+1)==0) {
buffer = F("MIME-Version: 1.0\r\n");
client->print(buffer);
buffer = F("Content-Type: Multipart/mixed; boundary=frontier\r\n\r\n");
client->print(buffer);
g_client=client; g_client=client;
script_send_email_body(xsend_message_txt); script_send_email_body(xsend_message_txt);
} else { } else {
#endif
buffer = F("\r\n");
client->print(buffer);
client->println(msg); client->println(msg);
#ifdef USE_SCRIPT
} }
#else
client->println(msg);
#endif #endif
client->println('.'); client->println('.');
#ifdef DEBUG_EMAIL_PORT #ifdef DEBUG_EMAIL_PORT