I am trying to send an email from a system admin account which has send email and mass email enabled. I get:
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.: []
Error is in expression '{!sendEmails}' in component <apex:page> in page dmapp:dm_send_usage_details_admin
An unexpected error has occurred. Your solution provider has been notified. (DMAPP)
Code to send email is like:
Messaging.SingleEmailMessage msg = new Messaging.SingleEmailMessage();
msg.setToAddresses(new String [] {emailAddress});
msg.setSaveAsActivity(false);
msg.setPlainTextBody(emailMsg);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {msg});
Any tips?