-
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

Top Reasons to Attend Dreamforce 2024
Table of Contents Top Reasons to Attend Dreamforce 2024 Cutting-Edge Keynotes and Sessions Learn the Hows and Whys of Trusted AI Be on the…

Drive Higher Channel Sales and Manage Partner Relationships with DemandBlue's Salesforce Experience Cloud Implementation
Regardless of your industry, it is apparent that today’s customers expect “as given” a digital self-service capability for their B2B buying process. Your channel partners…

Exploring the Future of Salesforce Custom Development: Predictions and Trend
Businesses want to keep their customers happy, and customers want great experiences that meet their needs. That's where Salesforce comes in. It's a top-notch platform…
Popular Salesforce Videos
Salesforce Summer ’22 Release | Flow Enhancement of Summer 22 Release with Example
Exceed your business goals with the Summer ’22 release by seamlessly integrating your data, finding meaningful insights, and building lifelong customer relationships. How to Use…
How to Create a File Location in Salesforce Marketing Cloud
Cameron Robert shows how to use PuttyGen to generate and create an SSH Key for SFTP usage in Salesforce Marketing Cloud, then how to create…
Spring '21 Release - Time-dependent Action in Salesforce Flows
If you’re familiar with scheduled actions in Process Builder or time-dependent actions in workflow rules, know that scheduled paths on record-triggered flows can accomplish the…