• Sara Rudraraju
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I am getting this error when excetuing below script as an API User. I am able to send the email successfully when running the same script with my account.
API User's profile has Mass Email and Send Email enabled. It also has Read and View All permission on Accounts and Contacts.

Org Wide Perms:
Deliverability>Access level = All Email
Respect SendEmail API - Enabled
SendEmail API - Enabled

Scritp:
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTargetObjectId('0033000001rfDgk');
mail.setTemplateId('00X0M000001XnpM');
mail.setOrgWideEmailAddressId('0D230000000EvAC');
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

Error:
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.: []

What else can I enable to give the API user access to run the script successfully.

Thanks in Advance!

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

 

 

  • January 18, 2010
  • Like
  • 0