Sign In  Sign Up Live-Chat

Corrupted attachment in MSG

Last post 07-25-2008, 5:28 AM by saqib.razzaq. 2 replies.
Sort Posts: Previous Next
  •  07-25-2008, 2:13 AM 136870

    Corrupted attachment in MSG

    We save PDF attachments in an MSG message using

    Dim message As MailMessage

    message = MailMessage.Load(TempFilename, MessageFormat.Msg)

     Dim MsgFS As FileStream = New FileStream(MsgTempFileName, FileMode.CreateNew, FileAccess.Write, FileShare.Write)

       message.Attachments(iAtts).SaveRawContent(MsgFS)

    However, Acrobat Reader refuses to read the saved PDF file. Error mesage mentions an incorrect decoding of an email attachment.

     

    Please advise

     
  •  07-25-2008, 2:46 AM 136876 in reply to 136870

    Re: Corrupted attachment in MSG

    Just to test a workaround, we changed to:

    Dim MapiMsg As Aspose.Network.Outlook.MapiMessage = Aspose.Network.Outlook.MapiMessage.FromFile(TempFilename)

    MapiMsg.Attachments(iAtts).Save(MsgTempFileName)

     

    And we still have (corrupted) improperly decoded PDF files.

     

    Please advise

     
  •  07-25-2008, 5:28 AM 136911 in reply to 136876

    Re: Corrupted attachment in MSG

    Hi Manuel,

    Could you please send us the sample msg file for which this error is occurring. And please also mention the OS, .net version and Aspose.Network version that you are using.

    I just tested the attached msg file and saved the pdf attachment without any trouble. The code I used is given below:

    Dim msg1 As Aspose.Network.Outlook.MapiMessage = Aspose.Network.Outlook.MapiMessage.FromFile("d:\temp\test1.msg")

    For Each att As MapiAttachment In msg1.Attachments

    att.Save("d:\temp\" & att.LongFileName)

    Next att


    Best Regards,

    Saqib Razzaq
    Support Developer
    Aspose Guangzhou Team

     
View as RSS news feed in XML