global class EmailAcknowledgment implements Schedulable { public List contactList{get;set;} // public List contactEmail{get;set;} public Map contactMap{get;set;} global void execute(SchedulableContext ctx) { // TODO: your code here contactList=new List(); contactEmail =new List(); contactList.clear(); contactEmail.clear(); contactList=[select id,Email,Name,Date__c from Contact where Date__c !=:system.today()]; contactMap =new Map(); for(Contact u:contactList) { system.debug('_____________id______'+u.id+'___________Email______________'+u.Email+'_________DATE______________________________________'+u.Date__c); contactMap.put(u.id,u.Email); if(u.Email!=null) contactEmail.add(u.Email); } if(contactEmail.size()>0) sendmail(contactEmail); } public void sendmail(List str) { Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); string [] toaddress=str; String[] ccAddresses=new String[]{'allwin.joshi@kvpcorp.com'}; email.setSubject('Mass Email'); email.setHtmlBody('Dear Sir /Madam,

Hello,

Your Profile is Created !!!

Sincerely,


Date :'+string.valueof(system.today())); email.setToAddresses(toaddress); email.setCcAddresses(ccAddresses); Messaging.sendEmail(New Messaging.SingleEmailMessage[]{email}); } }