.Net Core how to show display name instead of Email address?

512 views Asked by At

I've built an email service using SMTP (System.net.mail nuget package) which also sends out text messages. When I send an email it shows the display name using the following technic:

MailAddress from = new MailAddress("[email protected]", "DisplayName");

But while sending text messages it doesn't work. It shows the entire email address instead of the display name. Attached is the snapshot for reference. enter image description here

0

There are 0 answers