asp.netoutlooksmtpclientforwardingindependentsoft

Independentsoft generated .msg Messages losing attachments when forwarded


I have got an issue that to be honest I initially did not think was a programming issue, but after checking all other areas I would appreciate your feedback if this could possibly be one.

We have an ASP.NET web application that sends emails with attachments to users. Once sent the message is saved as a .msg file in SharePoint. All of this works correctly and reliably.

The issue we have found is that when a user opens the .msg file (i.e. downloads it from SharePoint) and then forwards it the attachments fall off the email. The attachments are in the .msg file, and can be opened and viewed - the issue is ONLY when they forward it (the docs disappear when they press forward).

Users are using Outlook (a variety of versions) and Internet Explorer.

I have tried the following to eliminate non-programming explanations:

  1. Forward the actual email sent - this works (i.e. attachments are kept)
  2. Take the content and attachment from msg file, send and then forward - this works
  3. Take this email, upload to SharePoint, download and forward - this works
  4. Take the generated .msg file and save locally. Open and forward - this does NOT work
  5. Open the generated .msg file from SharePoint - this does NOT work
  6. Change all the appropriate trust / intranet settings - no difference
  7. Forward the generated .msg - files are still missing when recieved

Emails are sent using standard SmtpClient functionality, I don't think* this should be the area I need to address. We are using a third party component called Independentsoft to generate our .msg file, I think this is likely to be the area we need assistance on.

The extract for this is fairly simple:


Message mailMsg = new Message();
// configuration, set email addresses, etc...

foreach (Document doc in msg.Documents)
{
    Attachment attachment = new Attachment(doc.Path);
    mailMsg.Attachments.Add(attachment);
}

Any thoughts on what might be causing this would be much appreciated


Solution

  • This ended up being a fairly simple resolution.

    On the Message class a collection exists called MessageFlags. Simply add the MessageFlag.HasAttachment when required