发送邮件 MailReplyTo 到问题

[ad_1]

你好,
发送邮件时我想设置回复但它不起作用。
当收到邮件后点击回复时,它显示回复邮件的来源,而不是我设置的。

我正在做这个

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>

解决方案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);

快乐编码:) 🙂 🙂

[ad_2]

コメント

标题和URL已复制