November 21, 2012

What is the difference between SingleEmailMessage and MassMailMessage

The SingleEmailMessage can send message related to only single record.
MassEmailMessage can send mails related to multiple records (WhatId and TargetObjectId).
setTargetObjectId - The ID of the contact, lead, or user to which the email will be sent.
setTargetObjectIds - A list of IDs of the contacts, leads, or users to which the email will be sent.
Used for single record
Used for multiple records

No comments:

Post a Comment