Hi,
We use Aspose.Email to load eml files, convert the MailMessage to MapiMessage for mail processing, and finally save it back to eml file.
Our code is like:
MailMessage emlmailmsg = MailMessage.Load(stream);
var mapimsg= MapiMessage.FromMailMessage(emlmailmsg, new MapiConversionOptions(OutlookMessageFormat.ASCII));
mapimsg.Save(@"C:\TestFiles\testoutput.eml", SaveOptions.DefaultEml);
When we open the saved testoutput.eml file in VS code, we found the Content-Transfer-Encoding is set to “quoted-printable”, which seems to make the dots “.” encoded as “=2E” in the mail body:
----_=_NextPart1_8fbc26a5-073a-447d-8dd4-77e5431fd623
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Sender: Mohan=2ESee@alpha=2Ecompany=2Ecom
Subject: Email 1: (Internal use only) with Protected attac=
hment
Message-Id: <9d2276845106446b9f1c5ea79d2a0b0c@alpha=2Ecompany=2Ecom>
To: Varun=2EAgg@alpha=2Ecompany=2Ecom
Is there a way for us to change the value of Content-Transfer-Encoding so that the characters in the output mail body are not encoded?
The input eml file is like this and we hope the output can be the same:
--_b0c17d78-c4d4-4e9b-8bf6-4c19fe38e3a4_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: Mohan.See@alpha.company.com
Subject: Email 1: (Internal use only) with Protected attachment
Message-Id: <9d2276845106446b9f1c5ea79d2a0b0c@alpha.company.com>
To: Varun.Agg@alpha.company.com
Troubleshooting we have taken:
1, If we directly save as eml file before calling MapiMessage.FromMailMessage, it maintains the original Content-Transfer-Encoding value and text is not encoded. So it seems MapiMessage.FromMailMessage changes the Content-Transfer-Encoding to “quoted-printable”.
2, If we call mapimsg.ToMailMessage to convert it back to MailMessage and save, the result is the same.
Any help would be really appreciated!