Find your content:

Search form

You are here

Salesforce inbound email to .msg attachment - Not opening in Outlook

 
Share

An inbound email is converted to the outlook .msg file and stored as an attachment to a record using handler class. Everything works fine, except I get this error when I try to open the file with outlook "Cannot start Microsoft Outlook. We can't open ..... It's possible the file is already open, or you don't have permission to open it. To check your permissions, right-click the folder, then click Properties." What am I missing?

Attachment.Name = attachmentname + '.msg'
ContentType ='application/vnd.ms-outlook'
body = Blob.valueof(email.plainTextBody)

Attribution to: Raish

Possible Suggestion/Solution #1

I'm not an expert on .msg files, but it seems that you need to do more than just declare the contenttype, change the name, and put the body into the attachment.

http://www.fileformat.info/format/outlookmsg/

Looks far more complicated.


Attribution to: DavidSchach
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/33282

My Block Status

My Block Content