Click here to Skip to main content
15,899,124 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
while sending mail i want to set reply to but it's not working.
When click on reply to after getting mail it show reply to from where mail come not what i have set.

i am doing this
XML
System.Net.Mail.MailMessage oMailMessage = new System.Net.Mail.MailMessage();
<pre lang="cs">oMailMessage.ReplyToList.Add(MailReplyTo);
                  oMailMessage.Headers.Add(&quot;Reply-To&quot;, MailReplyTo);</pre>
Posted
Comments
jo.him1988 9-Jul-14 6:39am    
hi, hope this will work for you, i have tested working fine for me :)

1 solution

System.Net.Mail.MailMessage oMailMessage = new System.Net.Mail.MailMessage();
        string MailReplyTo ="reply2Himanshu@gmail.com";
        oMailMessage.To.Add("himanshu.joshi@yahoo.com");
        oMailMessage.From = new System.Net.Mail.MailAddress("jo.him@gmail.com");
        oMailMessage.Subject = "test";
        oMailMessage.Body = "Hi this is test Mail";
        oMailMessage.ReplyToList.Add(MailReplyTo);
        oMailMessage.Headers.Add("reply-To", MailReplyTo);
        SmtpClient client = new SmtpClient("MyServer", 25);
        client.Credentials = new NetworkCredential("jo.him@gmail.com", "joPassword");   
         client.Send(oMailMessage);



happy coding :) :) :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900