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
Salvatore MignognaSalvatore Mignogna 

How to obtain original toAddress of an email redirected to a Salesforce email service

Hi,

 

my email box redirects the received emails to a Salesforce email service. The original toAddress is modified with the address of the target Salesforce email service in the redirection process

 

Is there a way to obtain the original toAddress of the email received by the Salesforce email service?

 

Thanks,

 

Salvatore

 

Alok_NagarroAlok_Nagarro

Hi,

 

I guess you can obtain fromAddress(that is indirectly original toAddress) from email in salesforce

OivlaSforceOivlaSforce

Ok,

 

but what about the original toAddress?

Can I obtain this information in the salesforce email service?

 

Thanks

Alok_NagarroAlok_Nagarro

Hi,

 

Let's say you got a mail in your mailbox(email id is - abc@abc.com) - means the original ToAddress of this mail is your mailbox id i.e. abc@abc.com right ?

 

Now when you mailbox forward this mail to salesforce id then your mailbox id(abc@abc.com) will set as fromAddress in the mail. So nw you can extract that from Address in salesforce- and this fromAddress(abc@abc.com) is the origuinal ToAddress on which you got this mail in your mailbox.

OivlaSforceOivlaSforce

The scenario is quite complex, I'll try to explane you.

 

I have to manage Inbound and Outbound emails.

Inbound -> from external referent to my email box

Outbound -> from internal CRM user to external referent

 

For the inbound email,

I have to map the emails with a specific support box in my CRM. I have a single email box mapped with different alias. The support box is defined based on the specific alias.

 

For the outbound email,

the email sended by the email box are also sended to the same email box (as CCN) then the email box automatically redirects the email to the Salesforce email service. So, I loose the information about the real toAddress and I don't know how manage the email in the Salesforce email service.

 

 

Thanks

 

OivlaSforceOivlaSforce

Resolved,

 

the object MessagingEmail has the headers field that contains a list of InboundEmail.Header object. Iterating on this list I found the original toAddress contained into the original email header .

 

Thanks