All base email (Email class) methods are also available to the MassEmailMessage objects.
The following are methods for MassEmailMessage. All are instance methods.
public Void setDescription(String description)
Type: Void
public Void setTargetObjectIds(ID[] targetObjectIds)
Type: Void
You can list up to 250 IDs per email. If you specify a value for the targetObjectIds field, optionally specify a whatId as well to set the email context to a user, contact, or lead. This ensures that merge fields in the template contain the correct data.
Do not specify the IDs of records that have the Email Opt Out option selected.
public Void setWhatIds(ID[] whatIds)
Type: Void
The values must be one of the following types: