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
Ted TkTed Tk 

Apex Single Mail Message Issue

Hi,

I have a code, where when a status is changed mail will be triggered.

Below is the snippet:
    mail.setReplyTo('abc@abc.com');
    mail.setSenderDisplayName('Test Sender Name');

When I receive the mail, it shows in display name as my name in the to list but when I click reply it is showing "abc@abc.com". I am confused. Can you please help me out?
Tavva Sai KrishnaTavva Sai Krishna
Hi Ted,

As you set the reply mail id to ''abc@abc.com" and display name as "Test Sender Name" it means that the email was triggered from the salesforce Org with the sender name as "Test Sender Name" and his email is "abc@abc.com". So you  are recieving email with the name as "Test Sender Name" and when you click on reply in outlookmail it is displaying as "abc@abc.com" .

Regards,
Sai Krishna Tavva.
Ted TkTed Tk
No,

It is not taking display name as "Test Sender Name" instead it is taking display name as "Ted Tk".