We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

E-Mail signature prevents conversion to MHTML / PDF Format

The attached E-Mail contains a signature. If the e-mail is converted to MHTML format the complete body disapears.

Best regards, Martin

Aspose.Email.dll Version 18.12.0
Email with signature - see https://cloud.cc-egov.de/index.php/s/S6GEawj4s6aPDe7
Internal bugid#28387

Example Code:
string strSourceFN = @“c:\temp\Test1.msg”;
MapiMessage mailMsg = MapiMessage.Load(strSourceFN, new MsgLoadOptions() { });

        MemoryStream memStream= new MemoryStream();
        mailMsg.Save(memStream, new MhtSaveOptions() { SaveAttachments=false, SkipInlineImages=true });

        memStream.Position = 0;
        Aspose.Words.Document doc = new Aspose.Words.Document(memStream, new Aspose.Words.LoadOptions() { LoadFormat= Aspose.Words.LoadFormat.Mhtml });

        string strDestFN = @"c:\temp\Test1.pdf";
        if (File.Exists(strDestFN)) File.Delete(strDestFN);

        doc.Save(strDestFN, Aspose.Words.SaveFormat.Pdf);

By the way, the RemoveSignature() functions doesn’t work either. After the signature is removed (see code below), the complete body is missing.

Example 1:
string strSourceFN = @“c:\temp\Test1.msg”;
MailMessage mail = MailMessage.Load(strSourceFN, new MsgLoadOptions() { });
if (mail.IsSigned)
{
mail.Save(strSourceFN, new MsgSaveOptions(MailMessageSaveType.OutlookMessageFormatUnicode) { PreserveSignature= false }); // doesn’t work, body is lost
mail.Dispose();
}

Example 2:
string strSourceFN = @“c:\temp\Test1.msg”;
MailMessage mail = MailMessage.Load(strSourceFN, new MsgLoadOptions() { });
if (mail.IsSigned)
{
mail.RemoveSignature(); // doesn’t work, body is lost
mail.Save(strSourceFN, new MsgSaveOptions(MailMessageSaveType.OutlookMessageFormatUnicode) {});
mail.Dispose();
}

@m.pfeifer,

I have observed the issue shared by you and have found that you are using a fairly older version of Aspose.Email. I suggest you to please try using Aspose.Email for .NET 20.3 on your end and in case there is still an issue then please share the source files, generated output and issue details with us.