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

Using mail.setOrgWideEmailAddressId requires authorisation.

I'm trying to do the following in Salesforce Sites:


            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            String[] toAddresses = new String[] {opp.Owner.Email};

But whenever I use/set the setOrgWiseEmailAddressId Salesforce sites says that I need authorisation. I just want to change the from address in the email. Can you use organisational wide email addresses in Salesforce Sites?



I have used this for sites also and its working. I think you are geting this error because the email which you are geting through the query is not authorized. Please check that email status inside Organization-Wide Email Address(Setup->AdminSetup->EmailAdministration->Organization-Wide Email Address) that it is verified or not??????



Think this will help you.


Yes, its right, org wide email address must be verified before use .


Yes it was verified but still didn't seem to work :(

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