How to send mail with reply to

In this post I want to show How we can send mail with reply to option in .NET. I means, for example we sent auto mail to site user using But That user need you support, then mail content. So he will try to use reply option for that mail. once he/she click on reply button, it will add To: text with here we can’t see same id( Or sometimes we need to set job to look reply mail by another person that time we can use this option.

I hope some of them knows about this already, I posted for this to help beginners.

First I am going to show screen shot about what I am going to doing in this.

I sent mail using to In this mail I set reply to mail option to

Subject: This is for Demo

Body: This is just for demo about reply to mail option in C#

Once it is deliver, in that mail we can see like this  reply to option in the mail details. Once user click on the reply option. Then that mail ID is added in the To mail box. See in this

Sent mail with Reply To in

Send mail with reply to option in

This we can do in well, we can do it same in too. But here I added only C# code Please check that code.

//This below code using System.Web.Mail
void SendUsingWebMail()
System.Web.Mail.MailMessage msgMail = new System.Web.Mail.MailMessage();
msgMail.To = "";
msgMail.From = "";
msgMail.Headers.Add("Reply-To", "");
msgMail.Subject = "This is for Demo";
msgMail.BodyFormat = System.Web.Mail.MailFormat.Text;
//This below code using System.Net.Mail
void SendUsingNetMail()
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(,   "");
msg.ReplyTo = new System.Net.Mail.MailAddress("");
msg.Subject = "This is for Demo";
msg.Body = "This is just for demo about reply to mail option in C#";

Please note here both methods used to send mail only, I method I used Web.Mail and other one Net.Mail

SendUsingWebMail(); //This is using System.Web.Mail

SendUsingNetMail();  //This is using System.Net.Mail recommended.

Both are working I tested. I hope it will work for you too, Sure.

Tip:- Please add import System.Net.Mail or System.Web.Mail at top.

I hope this code is helpful for you. If is there any better Idea then this please share with me.

Enjoy while coding..!


Naga Harish Movva.