Is it possible to set the sender name on a MailMessage
object? I tried setting it from MailAddress
, but the DisplayName
property seems to be read only.
I tried "My Name " as the sender and don't seem to work either.
Overview. When you send an email, the display name that appears next to your email address is called the Sender info. In Front, Sender info is tied to the signature that you use when sending an email. It can be changed in your signature settings at any time.
MailMessage mail = new MailMessage(); mail.From = new MailAddress("[email protected]", "Bob Jones" );
You do not need to use the MailAddress class.
You can let the runtime parse your string.
var message = new MailMessage( "My Name [email protected]", "Recipient One [email protected],Recipient Two [email protected]", "Subject", "Body");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With