List <Account> accountId=[SELECT Id FROM Account WHERE Name = 'Customer'or Name = 'Sales' or Name = 'order' ];
List <Contact> contacts=[SELECT id,Email FROM Contact WHERE AccountId = :accountId ];
Set<Id> contactEmails = new set<Id>();
for(Contact contact: contacts)
{
contactEmails.add(contact.Id);
}
Messaging.MassEmailMessage emails = new Messaging.MassEmailMessage();
emails.setTargetObjectIds(contactEmails);
emails.SaveAsActivity=(false);
Messaging.sendEmail(new Messaging.MassEmailMessage[] { emails });
return null;
Its showing the error:: method does not exist [messeging .mass email ] settargetobject id(set)