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
Steve Berley [Left Propeller]Steve Berley [Left Propeller] 

Sandbox: NO_MASS_MAIL_PERMISSION error despite Deliverability set to All Email

I'm running some code in a sandbox and am getting the error...
NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile.: []

However, my as you can see in my email settings - my deliverability is set to All Email.  What am I missing?  
User-added image

Thanks,

Steve 
Best Answer chosen by Steve Berley [Left Propeller]
Steve Berley [Left Propeller]Steve Berley [Left Propeller]
It ran in prod so - the answer cleaerly is...

Even if your production environment is sending emails - you can't assum the following to be true in its sandboxes 
 
You are missing a permission in the backend and must log a case with Salesforce support to enable "Respect SendEmail API" and "SendEmail API".

 

All Answers

Amit Chaudhary 8Amit Chaudhary 8
Please check below post for same issue
1) https://help.salesforce.com/HTViewSolution?id=000002868


The reasons are :
 >>Trial accounts do not allow the use of mass email. You will have to purchase a license to go live with your org.
 >>You are missing a permission in the backend and must log a case with Salesforce support to enable "Respect SendEmail API" and "SendEmail API".
 >>The access level might have been set to "system e-mails".
 In setup | Administration setup | Email Administration | Deliverability, verify if the access level is set to "All e-mails".
 
The e-mail deliverability is a new feature released in spring 13 and as per the release notes, all newly refreshed sandboxes default to "system email only"
 
Steve Berley [Left Propeller]Steve Berley [Left Propeller]
Thanks Amit...  Reviewing your three items...
  • It's in a licensed sandbox 
  • The prod instance has been sending emails for a long time so the requred APIs are enabled there and I'd be very surprised if those settings didn't make it into sandboxes.  (sandbox was created yesterday)
  • The access level is set to All Email as shown in the screen shot.
So - I'm stumped.

 
Amit Chaudhary 8Amit Chaudhary 8
Please raise a case in salesforce and check same issue by salesforce support.
Steve Berley [Left Propeller]Steve Berley [Left Propeller]
It ran in prod so - the answer cleaerly is...

Even if your production environment is sending emails - you can't assum the following to be true in its sandboxes 
 
You are missing a permission in the backend and must log a case with Salesforce support to enable "Respect SendEmail API" and "SendEmail API".

 
This was selected as the best answer