You need to sign in to do that
Don't have an account?
NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile.
Hi,
am trying to send the mass email to contacts.I am getting the error as below.Am doing this in a DE org.
System.EmailException:
SendEmail failed. First exception on row 0; first error:
NO_MASS_MAIL_PERMISSION, Single email is not enabled for your
organization or profile. Single email must be enabled for you to use
this feature.
My coding as below
private final List<Id> contactids;
public List<Contact> con;
public testemail(ApexPages.StandardController controller)
{
con = [select Id from Contact limit 5];
contactids=new List<Id>();
for(Integer i=0;i<con.size();i++)
{
contactids.add(con[i].Id);
}
}
public void SendEmail()
{
Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
mail.setTargetObjectIds(contactids);
mail.setTemplateId('00X90000000ZQgA');
Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
}
Can anybody tell me how to enable single email/mass email?
Thanks for any help
Resolved my email issue ! Good catch (Y)
https://help.salesforce.com/apex/HTViewSolution?id=000002868&language=en_US
API User's profile has Mass Email and Send Email enabled. It also has Read and View All permission on Accounts and Contacts.
Scritp:
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTargetObjectId('0033000001rfDgk');
mail.setTemplateId('00X0M000001XnpM');
mail.setOrgWideEmailAddressId('0D230000000EvAC');
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
Org Wide Perms:
Deliverability>Access level = All Email
Respect SendEmail API - Enabled
SendEmail API - Enabled
it may possible any othe reason?
I've create a visualforce page where the user could choose the folder and the email template to send mass email using an Apex Batch.
There was no problem showing the folders and emails to the user in the visualforce page.
This is the code I've used to send the mass email: And I get the error: On the Messaging.sendEmail line.
The problem was that the user was not included on the Public Group that have access to the email template folder.
After add the user to the Public Group, it worked just fine.
The error message NO_MASS_MAIL_PERMISSION says one thing but the problem was another ...
I have four unit tests that are failing because of this, and they pass because of the change, but won't this affect email settings outside of unit tests? If the emails are supposed to be sent on a trigger, then won't actual emails be sent when I'm inserting test data manually for functional tests? Could real customers wind up getting emails from Sandbox if their records were copied to a full Sandbox?