Gửi thư MailTrả lời vấn đề

lập trình


Xin chào,
trong khi gửi thư tôi muốn đặt trả lời nhưng nó không hoạt động.
Khi nhấp vào trả lời sau khi nhận thư, nó hiển thị trả lời từ nơi thư đến không phải những gì tôi đã đặt.

Tôi đang làm việc này

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>

Giải pháp 1

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);

chúc bạn viết mã vui vẻ 🙂 🙂 🙂

コメント

タイトルとURLをコピーしました