function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AK123AK123 

Inbound Email Headers

Hello, 

 

    We currently use Inbound Email services for our SF org, integrating various Outlook inboxes into SF as a custom object. I am having some difficulty collecting the inbound email headers from the email itself. If it helps, I am looking for a way to read the created date/time of email, which is contained in "email.headers", but I am getting errors try to capture and then display this information in SF. Any assistance or sample code will greatly be appreciated.

 

Thanks!

kiranmutturukiranmutturu
whats the issue you are facing ? unable to grab the date or any date formatting issues?
Sonam_SFDCSonam_SFDC

Hi,

Did you get a chance to go through the following KB:http://help.salesforce.com/apex/HTViewSolution?id=000004830&language=en_US

This explains how to access the header information from InboundEmail.header in Apex code

Hope this is helpful!

Link for reference:
http://login.salesforce.com/help/doc/en/code_inbound_email.htm

Ella Christina Lopez 1Ella Christina Lopez 1
I am having the same issue. It always says either "Variable does not exist"...So I inserted some code used for testing just to start me off but I really don't have much clue.

global class EmailtoAttendance implements Messaging.InboundEmailHandler {
      global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
          Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
         
          Attendance__c Attendance = new Attendance__c ();
          Attendance.Success_Agent_Name__c = email.fromName.substring(0,email.fromName.indexOf(' '));
          
            
         Messaging.InboundEmail.Header header= new Messaging.InboundEmail.Header();
         email.headers=new Messaging.InboundEmail.Header[1];
         header.name='Date'; header.value='';