Hello,
I use commercial version of Rebex Secure Mail .NET component for converting EML and MSG files to MHT format. After this, I use Microsoft Word public API to convert MHT file created by Rebex to PDF.
I have several issues I'd like to be fixed. The source EML files are available on (Microsoft Outlook 2010 is able to open all these EML files correctly!):
http://download.print-driver.com/files_exchange/mb/Rebex-EML-Component.rar
1) Rebex throws an exception when I try load 1-st file from this archive. My VB.NET source code is:
Dim msg As New MailMessage
msg.Load(sSrcFile)
2) Rebex is able to load 3 another EML files I sent you and even convert them to MHT. But, Microsoft Word 2010 is unable to open these MHT files. VB.NET code I use to convert EML to MHT is here:
Function MSG2MHT(ByVal mail As MailMessage, sOutMHT As String) As Boolean
If mail.IsSigned Then
mail.RemoveSignature()
End If
If mail.IsEncrypted Then
If Not mail.CanDecrypt() Then
ErrorMsgToLog("MSG2MHT - Unable to decrypt e-mail message.")
Return False
End If
mail.Decrypt()
End If
While mail.Attachments.Count > 0
mail.Attachments.RemoveAt(0)
End While
If Not mail.HasBodyHtml Then
If mail.HasBodyText Then
mail.BodyHtml = "<pre>" + HttpUtility.HtmlEncode(mail.BodyText) + "</pre>"
End If
End If
Dim i As Integer = 0
Do
If i > mail.AlternateViews.Count - 1 Then
Exit Do
End If
If mail.AlternateViews.Item(i).ContentType.MediaType = MediaTypeNames.Text.Html Then
i += 1
Continue Do
End If
mail.AlternateViews.RemoveAt(i)
Loop
mail.Save(sOutMHT)
Return True
End Function
Please let how to avoid issues I have. Or give me an idea when you will send me fixed version of Rebex Secure Mail .NET component!