Open ktadd opened 4 years ago
Looking at the source code I could see in mail.c that the body text is only MIME encoded if it's not, the only part in the mail, not 7-bit or there is a description added. I would suggest that the body text should always be MIME encoded if the mail is a multi-part email. I verified that if add a description to the body text, so that the body text is MIME encoded, than the Windows email program (OE Classic) can read email from Simplemail with attachments properly.
Here is the code segment I am referring to: From mail.c static int mail_compose_write(FILE fp, struct composed_mail new_mail)
if (convtext)
{
body = encode_body((unsigned char*)convtext, strlen(convtext), new_mail->content_type, &body_len, &body_encoding);
/* encode as mime only if body encoding is not 7bit or a content description was given */
if ((body_encoding && mystricmp(body_encoding,"7bit")) || new_mail->content_description)
{
if (new_mail->to) fprintf(ofh,"MIME-Version: 1.0\n");
fprintf(ofh,"Content-Type: text/plain; charset=%s\n",unicode?"utf-
8":best_codeset->name);
/* Write the Content Description out */
if (new_mail->content_description && *new_mail->content_description)
{
char *cd;
if ((cd = encode_header_field_utf8("Content-Description",new_mail-
>content_description)))
{
fputs(cd,fp);
free(cd);
}
}
}
free(convtext);
}
Hmm....seems as if I accidentally closed this issue. re-opening.
When Simplemail encodes the text in the emial before sending it is not tagging the text with the MIME identifier. This causes some email programs, like OE Classic on Windows to not know how to handle the email and it complains about improper MIME encoding..
The text should be tagged with the following MIME type descriptor as follows: ----==bound7220517ddb---- Content-Type: text/plain; charset=ISO-8859-1 Content-Description: 1st text
1st line of text in email message
The two Content- lines shown above are missing which is why some email programs may have issue with it. Please add the MIME descriptor for the text portions of the emails. Note that if I add a second text message to the same email it does not get the MIME descriptor either. The mostly causes a problem with you have a multi part email. Like when sending the text and having a picture attached to the email. That tends to be the case where other email programs can get confused if the text doesn't have it's MIME descriptor.