Skip to main content Stream TDX Bengaluru on Salesforce+. Start learning the critical skills you need to build and deploy trusted autonomous agents with Agentforce. Register for free.
3 answers
  1. Aug 31, 2022, 10:17 AM
    Hi, Enea Rushiti 

    EmailTemplate templateId = [Select id from EmailTemplate where name = 'Your template Name']; List<Messaging.SingleEmailMessage> allmsg = new List<Messaging.SingleEmailMessage>(); for(contact con : contactList) { Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); mail.setTemplateID(templateId.Id); mail.setTargetObjectId(con>id) mail.setSaveAsActivity(false); allmsg.add(mail); } Messaging.sendEmail(allmsg,false);

    Basically add all contact in the list and then send them in single shot. In one time you can send 100 emails. So this will solve your problem.

    l Hope This Is Usefull to U give me a Remark

    Thank you

    Vanaja Madireddy

     
0/9000