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 <vikram.dattu@espressif.com>
This commit is contained in:
Vikram Dattu 2020-11-10 10:41:32 +05:30
parent 33e7784806
commit 5fc644ac27

View File

@ -451,7 +451,7 @@ static void smtp_client_task(void *pvParameters)
len = snprintf((char *) buf, BUF_SIZE, len = snprintf((char *) buf, BUF_SIZE,
"Content-Type: image/image/png;name=esp_logo.png\n" "Content-Type: image/image/png;name=esp_logo.png\n"
"Content-Transfer-Encoding: base64\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); ret = write_ssl_data(&ssl, (unsigned char *) buf, len);
/* Image contents... */ /* Image contents... */