Change Email Display Name :-
In this post i going to show how to overwrite the E-mail sender’s display name in C#.NET. We can follow the same thing in VB.NET too. Email display name, it is shows information about email to receiver, Email Subject when it came who sent this mail. That place we can overwrite exist name with our special name. For example I sent mail from ID “email@example.com” to email ID “firstname.lastname@example.org”. So, once we opened the mail we can see sent from myemail or else mail configured name, I am not sure with this.
But we can overwrite that to you name “Email Sender’s Name”. but mail id will be same. It is very easy. Please follow below code, it is in C#.net.
using System.Net.Mail; // We must import System.Net.Mail, don’t forget about this.
public string SendMailWithSenderName()
using(MailMessage message = new MailMessage(
new MailAddress(“email@example.com”, “***Overwrite sender’s Name***”), //Sender email details
new MailAddress(“firstname.lastname@example.org”) //Receiver email, here no need to add display name.
message.Subject = “Mail Subject”;
message.Body = “Wow!, sender display name is changed..!”;
After sending mail, If we check that it will be like this
Sender name — ***Overwrite sender’s Name***
Subject — Mail Subject
Body — Wow!, sender display name is changed..!
I hope it is useful for your, if you have better idea then this please put it in comment, let me know thanks. Please ignore if I done any mistakes in this post.
Enjoy while coding..!
Naga Harish Movva.