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
timainmantimainman 

Set "From" email address in Apex email message?

Hey-

 

Pretty much think I know the answer to this one but I thought I would throw it out there to the group. I have a Apex script that sends an email based on a trigger. I would like the email to come from an email address other than the person who fired the triger. Looks like this is not possible. Any thoughts?

For example:

 

John Doe with the email address john.doe@acme.com fires a trigger when he updates an account. This trigger needs to send an email to another person Jane Doe. I would like this email to appear to come from Jane.Doe@acme.com not John.Doe@acme.com

 

Thanks in advance!

BritishBoyinDCBritishBoyinDC

Can't you do this via workflow? 

 

Or you might using this parameter:

setOrgWideEmailAddressId

timainmantimainman

I think you gave me the solution with the setOrgWideEmailAddressId. I missed that in the documentation.

 

Thanks!