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

Free Support Forum - aspose.com

Email attachment is not reading by the Aspose Email component for this attached item

Hello,

Please help me out on this issue as soon. Our production environment is down because this issue.

We are using Aspose component version Aspose.Network.dll 6.3.0.0.

Please rename the attached message file from .zip to .msg I am attaching as zip file extension.

msg object does not have the attachment count. for the message item

E201307120000015.msg

I have two message file attachement for you reference. Please check and let me know your solution for this. This is very urgent.

Not working -

E201307120000015.msg

Working -

E201307160000002.msg

Issue in this sample code.

private void BtnEmailAttachment_Click(object sender, EventArgs e)

{

byte[] bFile;

bFile = File.ReadAllBytes(@"C:\Email\InBox\E201307120000015\E201307120000015.msg"); // Attachment is not working

//bFile = File.ReadAllBytes(@"C:\Email\InBox\E201307160000002\E201307160000002.msg"); //Attachment is working

MemoryStream InputData = new MemoryStream(bFile);

Aspose.Network.Mail.MailMessage msg;

Aspose.Network.Mail.MessageFormat format = Aspose.Network.Mail.MessageFormat.Msg;

msg = Aspose.Network.Mail.MailMessage.Load(InputData, Aspose.Network.Mail.MessageFormat.Msg);

}

This is very urgent. Please help out

Thanks & Regards,

P. Saravanan.

Hi Saravanan,


Could you please check the attachments you have sent to me? One of these can’t be opened, while the other doesn’t contain any sample message files. Please verify it at your end and provide us with sample message files to further investigate this issue.

PS: Please use the latest version of Aspose.Email for .NET 3.1.0 to test this issue at your end and let us know your feedback.

Hi Iqbal,

Please download the file and Rename the extension .zip to .msg and try to open in the Outlook.

And take the attached sample code in my block and run the two .msg file.

If there is any issue Kindly let me know.

Attachment is not loading since the extension is .msg. Hence I renamed the extension is .zip.

Regards,

P. Saravanan.

Hi Saravanan,


I have tested this issue with the latest version of Aspose.Email for .NET 3.1.0 and the following code sample. As you can see in the attached screenshot, the message attachments information is read properly. Also, I have saved these messages to the disc and they are saved fine. Attachments are saved here for your reference. Please let us know your feedback then:

Sample Code:

Console.WriteLine(“Reading
1st MSG file…”
);<o:p></o:p>

byte[] bFile = File.ReadAllBytes("EMAIL_482991//E201307160000002.msg");

MemoryStream ms = new MemoryStream(bFile);

ms.Position = 0;

MailMessage msg = MailMessage.Load(ms);

foreach (Attachment att in msg.Attachments)

{

Console.WriteLine("Att Name: " + att.Name);

att.Save("EMAIL_482991//" + att.Name);

}

//Read the 2nd MSG file

Console.WriteLine("Reading 2nd MSG file...");

bFile = File.ReadAllBytes("EMAIL_482991//E201307120000015.msg");

MemoryStream ms2 = new MemoryStream(bFile);

ms2.Position = 0;

msg = MailMessage.Load(ms2);

foreach (Attachment att in msg.Attachments)

{

Console.WriteLine("Att Name: " + att.Name);

att.Save("EMAIL_482991//" + att.Name);

}


Hi Iqbal,

Thanks for the information!

Are you using Aspose.Network.dll or Aspose.Email.dll?

Becausing I am using in my project Aspose.Network.dll.

Should I replace this Aspose.Network.dll with Aspose.Email.dll?

Or can we download the Aspose.Network.dll latest version If you have the latest version please send me the link where i will take the latest version of Aspose.Network.dll.

Please advise

Thanks

P. Saravanan.

Hi Saravanan,


Aspose.Network is no more supported and has been discontinued. Now, Aspose.Email for .NET and Java are supported for Emails management by Aspose. Please download the latest version of Aspose.Email for .NET 3.1.0 and use this in your application. Let us know if we can be of any additional help to you.