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
Ashwani PradhanAshwani Pradhan 

Why display Name not showing up in email?

I am try below code and its not showing email display name, even its not showing full email address. Its just picking before the @ symbol like if my org wide address is then in from it will come asw_india_supp

Here is my code peice 
Messaging.SingleEmailMessage singEmail = new Messaging.SingleEmailMessage ();
	String [] toAddresses = new list<string> {''};
	//Set recipient list
	DateTime d = ;
	String dateStr =  d.format('MMM-dd-yyyy');
	// Use Organization Wide Address  
	for(OrgWideEmailAddress owa : [select Id, Address, DisplayName from OrgWideEmailAddress]) {
		if(owa.Address.contains('ir')) singEmail.setOrgWideEmailAddressId(; 

	singEmail.setToAddresses (toAddresses);
	singEmail.setSubject('Salesforce Contact Correspondence Details Report as of '+ dateStr);

	Messaging.SendEmailResult [] r = Messaging.sendEmail (new Messaging.SingleEmailMessage [] {singEmail});
Please help..
Anupama SamantroyAnupama Samantroy
Hi Ashwani,

The Display name is just the name which will be shown in the recipients email.You can go through this link
Display Name is the word or phrase users who receive your email will see as the sender of the email.

Try setting this attribute in the SingleEmailMessage
Ashwani PradhanAshwani Pradhan
Hi Anupama, I know that! But my client want like this to show to recipients  Salesforce Support<>, I guess this is because I am using an email group rather than a personal email in my org wide email.

Hi Vineet, We can not set display name if using setOrgWideEmailAddressId.

Yes you are correct, it cannot be set if using setOrgWideEmailAddressId.
I just tested your code and I was able to see the name<emailaddress>
There maybe a chance of the group email causing the issue, but I personally think that shouldn't be the issue.
SandhyaSandhya (Salesforce Developers) 
Hi Ashwani Pradhan,

Even I tested your code for me name displays, but when I hover it shows complete email id.

Thanks and Regards
Ashwani PradhanAshwani Pradhan
Yes it seems my email service provider overriding group email address and not showing like ABC <>

Thanks guys for helping.