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
Anjali Khilwani 7Anjali Khilwani 7 

how to send a mail to multiple recipients with number of pending items on each recipient in salesforce apex

Ajvad AjuAjvad Aju
Hi Anjali,

You can send a mail to multiple recipients in salesforce. for that modify your code with the following,
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(new String[] { 'TestUser@salesforce.com' ,'abc@test.com'});  //add other emails here.
Please refer below link for more details.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_sendemail.htm

Regards
Ajvad Aju