From 5fc644ac2751ebaa4a82c975e1342957538dbbc4 Mon Sep 17 00:00:00 2001 From: Vikram Dattu Date: Tue, 10 Nov 2020 10:41:32 +0530 Subject: [PATCH] Add newline separator to fix wrong attachment sent Issue: Missing newline between header and attachment Issue seen with email clients viz., AppleMail and YahooMail. Attachment is not renderable. Some clients like Google mail, Samsung mail tolerate the issue. Fix: Added newline between header and attachment. Closes https://github.com/espressif/esp-idf/issues/6098 Signed-off-by: Vikram Dattu --- examples/protocols/smtp_client/main/smtp_client_example_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/protocols/smtp_client/main/smtp_client_example_main.c b/examples/protocols/smtp_client/main/smtp_client_example_main.c index c07d39fefb..f8d4eeaf40 100644 --- a/examples/protocols/smtp_client/main/smtp_client_example_main.c +++ b/examples/protocols/smtp_client/main/smtp_client_example_main.c @@ -451,7 +451,7 @@ static void smtp_client_task(void *pvParameters) len = snprintf((char *) buf, BUF_SIZE, "Content-Type: image/image/png;name=esp_logo.png\n" "Content-Transfer-Encoding: base64\n" - "Content-Disposition:attachment;filename=\"esp_logo.png\"\n"); + "Content-Disposition:attachment;filename=\"esp_logo.png\"\r\n\n"); ret = write_ssl_data(&ssl, (unsigned char *) buf, len); /* Image contents... */