-
How can i show Record Owner name in From/Reply in Email sent through Salesforce?
I want to show Record Owner name in From/Reply in Email sent through Salesforce. Can anyone help me in achieving this thing?
Here is my code----
list<String> listOfEmailsAddress = new list<String>();
for(Lead leadobj : leadList){
String [] toRecipients = new String[] {leadobj.NominatorEmail__c};
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setToAddresses(toRecipients);
email.setSenderDisplayName(leadobj.Owner_Name__c);
email.setTargetObjectId(leadobj.Id);
email.setUseSignature(false);
email.setBccSender(false);
email.setSaveAsActivity(true);
email.setTemplateId(templateId);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
}
Log In to reply.
Popular Salesforce Blogs

Enhance Your Fundraising Efforts by Integrating Your Organization's System With Salesforce
As per Salesforce.org's Nonprofit Trends Report (3rd Edition), the pandemic forced 71 percent of organizations polled to speed up their transition to digital programs or…

Handle Events in LWC | All You Need to Know
A robust framework called Lightning Web Components (LWC) enables programmers to create web apps utilising current web standards like HTML, CSS, and JavaScript. Event management,…

Comparison Between Salesforce B2B and B2C Commerce Cloud Solutions
The proliferation of the internet and smart devices has forced us to enter the digital-first economy, where online trade has become the lifeline for most…
Popular Salesforce Videos
Salesforce Winter Release '22 Highlights
Watch this webinar video to learn about new and improved features and how you can take full advantage of the latest enhancements. Let us know…
Multipurpose VF Component to Add Multiple Records on a Button's Click | Salesforce Tutorials
In this video, I will create a multipurpose VF component to add Contact records in a list on the click of a button then I…
Dreamforce 2021 FAQs
As the fall continues to approach, questions around Dreamforce 2021 continue to increase and that's why we've gone ahead and answered all the FAQs around…