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

Not able to set "email.setSenderDisplayName" in Email


I have written a trigger and if some criteria is met it will fire an email.Everything is fine in my mail but i am not able to set sender display name also i have set (Email Aministration-->Deliverability-->and unchecked Enable compliance with standard email security mechanisms and Enable Sender ID compliance).Can you please help me out with this?? 

email.setToAddresses( toAddresses ); 
email.setSenderDisplayName ('Company name'); 




   I too have done the same thing at my end in a trigger and have set sender display name as per the following code:-

     email.setsenderdisplayName('Salesforce support')

     One also needs to do the following:-

     Under "Email Administration" setting one has to check both the checkboxes under the section "Email Security             Compliance" .  It works fine when one takes the above actions.


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

Ramesh SomalagariRamesh Somalagari
Hi all,I have same issue some one can help me