function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Send Emails in bulk

I would like to send emails in bulk in salesforce in apex code. I tried using MassEmailMessage option, But setWhatIds is allowed for only Contract
Case,Opportunity,Product. I would like set whatId with my custom object. Please suggest some solution.
ShashankShashank (Salesforce Developers) 
Unfortunately, massemailmessage is not available for custom objects:

As a workaround, you can use singleemailmessage in a loop.
jaya sai prasadjaya sai prasad

MassMailer lets you send bulk emails within Salesforce, no matter which edition you use. Built on the Salesforce platform, it has all the mass email features you’ll ever need.
  • Send unlimited emails no matter how large your email list is Native Salesforce integration for a seamless experience
  • Beautiful email templates complete with HTML and text versions
  • Simple email creation wizard for point-and-click ease
  • Detailed metrics,monitoring & tracking so you’re always in the know
  • Email verification & deliverability tools to make sure your emails reach your prospects
Here is the link for appexchange listing for the MassMailer app
Learn more about MassMailer here