I have an application in which files from the file system, emails from Outlook, or attachments from Outlook are dragged and deleted, and then they are saved in the folders of the file system for subsequent upload to SharePoint.
All of this is great if I need to identify the contents of the attachment, which is an email (i.e. email attachment in MSG's built-in email), where FileContents are NULL. Is there a way to access email content to save as a .msg file?
The following code snippet creates MemoryStreamcorrectly for attachments that are not email messages, but null for email types:
void DoDrop(object sender, DragEventArgs e)
{
var memoryStream = (MemoryStream) eventArgs.Data.GetData("FileContents", true);
}
source
share