Free Support Forum - aspose.com

No Attachments Found After in EmailMessage Although One Exists

Hi There,

I am using Aspose.Email.19.6.0. After extracting EmailMessage using EWSClient.GetEWSClient(ServerHost, credentials).FetchMessage(msgInfo.UniqueUri) it seems the attachments collection is empty although one attachment exists.
It’s odd since I see the attachment under ExchangeMessageInfo.Attachments (with some other pngs which are part of e-mail’s signature)
Unfortunately, I could not upload the email here.

Thanks,
Shlomi

@shlomi.zeevy,

I have observed the issue shared by you and request you to please try using Aspose.Email for .NET 20.1 on your end. If there is still an issue then please share the working sample code along with account credentials that we may use on our end to verify the same.

@mudassir.fayyaz I tried also with v20.1 on a side project. (Loaded my e-mail msg and queried attachments), still no luck.
Please see attached:
FW Pnr 724326.Tickets.msg.zip (139.9 KB)

@shlomi.zeevy,

I have worked with MSG file shared by you and have observed the issue. An issue with ID EMAILNET-39739 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

The issues you have found earlier (filed as EMAILNET-39739) have been fixed in this update.

Hi,

Unfortunately, I see that issue is still reproducible with new version (Aspose.Email for .NET 20.2).
After calling line of code below, there were no attachments on message.
var message = MailMessage.Load(GetMessagePath(“FW Pnr 724326.Tickets.msg”), new MsgLoadOptions());

Regards,
Shlomi

@shlomi.zeevy,

I have tested using Aspose.Email for .NET 20.2 on my end and have been able to extract the attachments successfully. I have not been able to observe any issue.

Extracted Attachments.zip (16.6 KB)

Hi,

After upgrading to Aspose.Email 20.3 the issue is still reproducible. In your zip file there is one file missing which is the main attachment.tmp6A6F.cleaned.pdf (110.8 KB).
Please advise.

Shlomi

@shlomi.zeevy,

Can you please check my last reply in which I shared the details with you using Aspose.Email for . NET 20.2. Can you please confirm, if Aspose.Email for .NET 20.2 gives you desired results as shared by me or that too have issues.

Hi,

Not 20.3 nor 20.2 version give me the desired results.
There is an attachment missing…like i mentioned in my last reply to you.

@shlomi.zeevy,

I have tried using Aspose.Email for .NET 20.3 as for your shared file and it has extracted the attached PDF as well. Please check the following zip file with extracted attachments.

    public static void ExtMsg()
    {

        String path = @"C:\Users\mudas\Downloads\FW Pnr 724326.Tickets.msg(1)\";

        MapiMessage message = MapiMessage.FromFile(path + "FW Pnr 724326.Tickets.msg");


        // Iterate through the attachments collection
        foreach (MapiAttachment attachment in message.Attachments)
        {
            try
            {
                // Save the individual attachment
                attachment.Save(path + attachment.FileName);
            }
            catch (Exception e)
            {
                String s = e.StackTrace;

            }

        }
    }

FW Pnr 724326.Tickets.zip (112.7 KB)