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
Michael MMichael M 

Customize MassEmail reply destination address

Hello,
I send out mass emails (through Apex) monthly, and the "from" person changes based on who the email is going to. Currently, if any recipients of the email reply, the reply comes to my inbox. Is there a way to set the address where replies should go? Any help is greatly appreciated. 
Best Answer chosen by Michael M
Christan G 4Christan G 4
Thank You Michael for the quick response. After researching more, it seems MassEmailMessage class inherits methods from the Email class and within that class, there is a method called .setReplyTo(String replyAddress) which specifies where a user's reply email is sent. This should fulfill your requirement. I've written an example code below. Please feel free to reach out to me if you have any more questions.
Messaging.MassEmailMessage oneMass = new Messaging.MassEmailMessage();

oneMass.setReplyTo('testEmail@apextest.com'); //All replies will be sent to this email.

All Answers

Christan G 4Christan G 4
Hi Michael, I hope you are well. Are you sending these emails using the MassEmailMessage class or SingleEmailMessage class?
Michael MMichael M
Hi Christan, I am sending them using MassEmaiMessage class. 
Christan G 4Christan G 4
Thank You Michael for the quick response. After researching more, it seems MassEmailMessage class inherits methods from the Email class and within that class, there is a method called .setReplyTo(String replyAddress) which specifies where a user's reply email is sent. This should fulfill your requirement. I've written an example code below. Please feel free to reach out to me if you have any more questions.
Messaging.MassEmailMessage oneMass = new Messaging.MassEmailMessage();

oneMass.setReplyTo('testEmail@apextest.com'); //All replies will be sent to this email.
This was selected as the best answer
Michael MMichael M
This worked, and good to know. Thank you.