Thursday, January 31, 2013

Difference Between SingleEmailMessage and MassEmailMessage?

SingleEmailMessage:


  • The SingleEmailMessage can send message related to only single record.
  • setTargetObjectId - The ID of the contact, lead, or user to which the email will be sent.
  • Used for single record
  • Messaging.SingleEmailMessage

MassEmailMessage:

  • MassEmailMessage can send mails related to multiple records (WhatId and TargetObjectId).
  • setTargetObjectIds - A list of IDs of the contacts, leads, or users to which the email will be sent.
  • Used for multiple records
  • Messaging.MassMailMessage

0 comments:

Post a Comment