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
OdedHarnivOdedHarniv 

NO_MASS_MAIL_PERMISSION when using a guest user profile

Hello all

 

I'm building a public portal where one of the things a user can request is to be sent an email with some info.

I'm using an APEX code with Messaging.SingleEmailMessage.

 

The problem is that I'm getting NO_MASS_MAIL_PERMISSION which might be because a Guest User Profile has no Send Email feature.

 

Is that correct?

What is the right way to send and email from APEX in such a case?

 

Thanks

 

Oded

Best Answer chosen by Admin (Salesforce Developers) 
Shashikant SharmaShashikant Sharma

just try one thing , remove with sharing key word from your class and then check results

All Answers

Shashikant SharmaShashikant Sharma

just try one thing , remove with sharing key word from your class and then check results

This was selected as the best answer
Shashikant SharmaShashikant Sharma

One reason might be that Guest User does not have the right on the record which you are using as targetObejectId. Check your sharing settings or Guest User profile rights.

OdedHarnivOdedHarniv

Super, it works

 

Thank you very much

Shashikant SharmaShashikant Sharma

Your Welcome Mate