2

I need to send email with .msg file attached to Lotus Notes (Domino) by using VSTO (from Outlook Add-In). When this file is received in Lotus Notes, the email body from msg file is appended to the end of the main mail.

From this problem I am assuming that the issue is in attachment type. I am trying to set the attachment type to by olByValue by adding attachment :

mail.Attachments.Add(msgFilePath, OlAttachmentType.olByValue, 0, displayName);

but whatever type I specify, it is still set to olEmbeddeditem.

Is there any way, how to force msg attachment to be olByValue?

Thank you for any suggestion or advise. Have a nice day.

Note: For reference I have created email in Lotus-Notes too with msg attached, sent to Outlook and than forwarded back to Lotus-Notes and msg is attached not appended to the end.

Community
  • 1
  • 1

1 Answers1

2

There is not much you can do in the Outlook Object Model - it always tries to be "helpful" and converts MSG files to embedded message attachments. If using Redemption is an option (I am its author), it will not change the type:

SafeMailItem sItem = new SafeMailItem();
sItem.Item = mail;
sItem.Attachments.Add(msgFilePath);
Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Tried, works. But actually, Redmption was not an option, due some internal policy - not white-listed (maybe yet?). At the end I have decided for workaround - to insert MSG into container (ZIP). There is no problem with setting olByValue for ZIP files. – dusan.suchon May 06 '16 at 08:10