+ Start a Discussion
Mandeep DekaMandeep Deka 

Fetch an email with FromAddress, ccAddress, time etc and then attach it to an Object


Here is what I am trying to achieve:

Using the Email Service in Salesforce, I am trying to fetch the inbound email and attach the whole email along with FromAddress, ccAdrress, sent time and other details and attach it to a custom object as an attachment. So that the user can view the attachment of a particular custom object record in its attachment related list.

Now, I am able to fetch each of this data from the Messaging.InboundEmail email of the inbound email separately and create attachments in that custom object but I am only able to attach the email body not the whole email information. And what I am trying to achieve is attach the whole email information as an attachment so that the user sees all the information of the email as an html page in a new tab when he/she clicks on the "View" link of the attachment.

Any ideas fellows? Thanks in advance!