Skip to main content

Posts

Showing posts with the label Send Email Via Apex

Send attachment Via Apex using Templates

Email Via Apex using Email Templates : Contact con = [Select id from contact Limit 1]; List<String> emailsAll = new List<String>(); emailsAll.add(' toEmailAddress@gmail.com '); List<String> emailsCC = new List<String>(); emailsCC.add('cC EmailAddress@gmail.com '); String TemplateId = [SELECT Id FROM EmailTemplate WHERE DeveloperName = 'Multi_Language_Template_Test' LIMIT 1].Id; List<Messaging.SingleEmailMessage> mails =  new List<Messaging.SingleEmailMessage>();                    // Step 1: Create a new Email         Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();                 // Step 2: Set list of people who should get the email         mail.setToAddresses(emailsAll);         mail.setCcAddresses(emailsCC);         // Step 3...

Translate