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

Free Support Forum - aspose.com

MSGs attached to MSG show as zero byte attachments in Outlook

Hi.
I’m using Aspose.Email for .NET 20.4.0 in evaluation.
When I attach an MSG to an MSG using the sample code shown here:
https://docs.aspose.com/display/emailnet/Working+with+Message+Attachments#WorkingwithMessageAttachments-EmbeddingMessageasAttachment
the resulting attached MSG shows as a 0 byte file in Outlook. However, the attached MSG file has size >0 and when the MSG attachment is opened in Outlook it displays correctly.
What do I need to do to get Outlook to display the true filesize of the attached MSG?

Many thanks,
Philip

@philip.crooks,

I have observed the issue shared by you and request you to please share the source MSG file, attachment file and generated output for reference. Please share the requested information so that I may proceed further with investigation on my end.

Hi,

I now have a working alternative (see below) but for your reference I’ve attached sample MSGs:
RESULT New Paths for New Stuff.msg
is the result of attaching
UBSW ENERGY KICK-OFF CELEBRATION.msg
to
New Paths for New Stuff.msg
using:
message.Attachments.Add("UBSW ENERGY KICK-OFF CELEBRATION.msg", MapiMessage.FromFile(attachmentFilePath))
as in this sample code:
https://docs.aspose.com/display/emailnet/Working+with+Message+Attachments#WorkingwithMessageAttachments-EmbeddingMessageasAttachment

However, I’ve found that attaching using File.ReadAllBytes(attachmentFilePath) instead of MapiMessage.FromFile(attachmentFilePath) results in the correct filesize shown for the attached MSG in Outlook, so I will use this variaton instead:
message.Attachments.Add("UBSW ENERGY KICK-OFF CELEBRATION.msg", File.ReadAllBytes(attachmentFilePath))

Thanks & regards,
Philip

SampleMSGs.zip (16.4 KB)

@philip.crooks,

I have read your comments. Can we consider the issue closed on our end now.

Yes thanks, I’ll just use the alternative method.

@philip.crooks,

Thank you for the feedback. Please share if I may help you in addressing any further issues incurring in API.