When the mail is received, in "from", I need to show the name of the person behalf of whom the mail is sent. I think what I need is the c# version of this answer
Thanks in advance
When the mail is received, in "from", I need to show the name of the person behalf of whom the mail is sent. I think what I need is the c# version of this answer
Thanks in advance
Try a look to MailMessage class. You have an example on that page.
MailAddress from = new MailAddress("ben@contoso.com", "Ben Miller");
MailAddress to = new MailAddress("jane@contoso.com", "Jane Clayton");
MailMessage message = new MailMessage(from, to);
message.Subject = "Using the SmtpClient class.";
message.Body = @"Using this feature, you can send an e-mail message from an application very easily.";
SmtpClient client = new SmtpClient();
client.Send(message);
Be aware that SmtpClient, without params, takes the configuration from app.config / web.config. You can see the mailSettings section for further configuration information