Saving to MSG problem when body is in MHT format

Last post 06-25-2009, 2:00 AM by saqib.razzaq. 3 replies.
Sort Posts: Previous Next
  •  06-19-2009, 9:17 AM 184624

    Saving to MSG problem when body is in MHT format .NET

    Attachment: Present (inaccessible)
    Hi,

    We have found issue while trying to save MailMessage (loaded from MHT file) to MSG file. Conversion finishes without exception, but MSG file does not contain any images and has broken HTML formatting :/

    What we have done:
    1) Converted DOC to MHT using Aspose.Words
    2) Created new MailMessage instance from resulting MHT file => MailMessage.Load()
    3) Created new MapiMessage instance by calling MapiMessage.FromMailMessage()
    4) Saving as MSG file by calling mapiMessage.Save()

    We have also tried to save MailMessage in EML format and converting file from EML to MSG, but the result was exactly same. We are using Aspose.Network version 4.6 but the problem occurs also in latest 4.7.

    I have attached zip file with following files for your testing purposes:
    1) C# file with unit test to look at the issue
    2) EML saved via Aspose - OK
    3) MSG daved via Aspose - ERROR
    4) MSG saved via Outlook 2007 - OK

    Can you please look at this issue?

    Martin
     
  •  06-21-2009, 6:00 AM 184724 in reply to 184624

    Re: Saving to MSG problem when body is in MHT format .NET

    Attachment: Present (inaccessible)

    Hi Martin,

    Thanks for considering Aspose.

    Saving an email (with embedded images) as msg does not work correctly in the current release. Its a known issue and we are working on it.

    But, if you load an mht file using Aspose.Network.MailMessage class and save as eml, embedded images are included in the eml file. If you open the eml file in Outlook Express, you will only see text first. To see proper message in Outlook Express, please select menu "View" --> "Message in HTML" and you will get the formatted text with embedded messages.

    I used the following code snippet for the conversion (similar to yours). Please also see the attached images of eml file, before and after viewing in HTML format.

    // step-1 - doc --> mht using Aspose.Words

    string strDocFile = @"E:\Data\Aspose\temp\MsgFromMht\MhtmlSmtpMailerTest.doc";

    string strEmlFile = @"E:\Data\Aspose\temp\MsgFromMht\NewEml.eml";

    string strMsgFile = @"E:\Data\Aspose\temp\MsgFromMht\NewMsg.msg";

    Document doc = new Document(strDocFile);

    MemoryStream stream = new MemoryStream();

    doc.Save(stream, SaveFormat.Mhtml);

    // step-2 - mht --> eml using Aspose.Network

    MailMessage eml = MailMessage.Load(stream, MessageFormat.Mht);

    eml.Save(strEmlFile, MailMessageSaveType.EmlFormat);

    // step-3 - eml --> msg using Aspose.Network

    eml.Save(strMsgFile, MailMessageSaveType.OutlookMessageFormatUnicode);

    stream.Close();


    Best Regards,
    Saqib Razzaq
    Support Developer, Aspose Sialkot Team
    http://www.aspose.com
    Your File Format Experts
     
  •  06-22-2009, 2:20 AM 184774 in reply to 184724

    Re: Saving to MSG problem when body is in MHT format

    Attachment: Present (inaccessible)
    Hi Saqib,

    Thanks for answer!

    1) Problem is not only embedded image, but also broken HTML formatting (line height) and attachments in body of mail instead in MAPI attachments property. See attached image for details.

    2) Do you know timescale when the solution/fixes will be provided (at least approximately - in weeks or in months)?

    The formatting issue is greater problem for us. We want to be able to send mails without images at least, when waiting for fixes.

    P.S. Eml is working perfectly, I dont even have to switch view to html. Unfortunately we cannot use Eml because of business requirements.

    Martin
     
  •  06-25-2009, 2:00 AM 185384 in reply to 184774

    Re: Saving to MSG problem when body is in MHT format

    Hi Martin,

    "Embedded images problem" and "attachments in msg body" are known issues and cannot be fixed in short time due to some complexities.

    I will get back to you after consulting with the development team on broken HTML formatting issue of the message body, when msg is created from doc --> mht --> eml --> msg.


    Best Regards,
    Saqib Razzaq
    Support Developer, Aspose Sialkot Team
    http://www.aspose.com
    Your File Format Experts
     
View as RSS news feed in XML