diff --git a/Sming/Components/Network/src/Network/SmtpClient.cpp b/Sming/Components/Network/src/Network/SmtpClient.cpp index 477436c6d5..0bad31c808 100644 --- a/Sming/Components/Network/src/Network/SmtpClient.cpp +++ b/Sming/Components/Network/src/Network/SmtpClient.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -296,6 +297,12 @@ void SmtpClient::sendMailHeaders(MailMessage* mail) mail->stream = std::make_unique(mail->stream.release()); } + if(!mail->headers.contains(F("Message-ID"))) { + Uuid uuid; + uuid.generate(); + mail->headers[F("Message-ID")] = "<" + uuid.toString() + "@" + url.Host + ">"; + } + if(!mail->attachments.isEmpty()) { MultipartStream* mStream = new MultipartStream(MultipartStream::Producer(&SmtpClient::multipartProducer, this)); MultipartStream::BodyPart text;