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

how to set "to address" display name in email?



I hope you all are doing well.Here i have one requirement.I have to set displayname for to address in email. can anyone help me in this problem.Below is the example that i have given:-


in to address it si displayed as :- "" <>

I want to show like :- "Minkesh Patel" <>



Minkesh Patel

Sankalp JhingranSankalp Jhingran

Hi Minkesh,


You can use the setSenderDisplayName method of the SingleEmailMessage to set the senders display name in the outgoing email.

SingleEmailMessage.setSenderDisplayName('Sankalp Jhingran');


You can also change your personal email settings by going to Personal Setup > My Email Settings  and setting Email Name field, it will use this name for the outgoing emails from the corresponding logged in user. 


Hope that helps!