2011-09-25 69 views
7

如何通过smtp发送电子邮件作为Gmail通话的一部分? 采取相同的主题不工作...gmail通过smtp对话

告诉我,如果您需要更多的信息.​​.. 在此先感谢!

 MailMessage mail = new MailMessage(); 
     SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); 

     mail.From = new MailAddress("@googlemail.com"); 
     mail.To.Add("@.com"); 
     mail.Subject = "(Somee.com notification) New order confirmation"; 
     mail.Body = "(Somee.com notification) New order confirmation"; 

     SmtpServer.Port = 587; 
     SmtpServer.Credentials = new System.Net.NetworkCredential("", ""); 
     SmtpServer.EnableSsl = true; 

     SmtpServer.Send(mail); 

回答

7

你需要使用以下命令:

mail.Headers.Add("In-Reply-To", <messageid>); 

消息ID,你应该能够从以前的电子邮件的标题来获得。只需查找“Message-Id”即可。

This answer给出了一些您可能想要添加的标题,以帮助其他客户端尝试帮助线程。看来也许gmail现在也在使用这些。

+2

要完全清楚。那''看起来像这样'<[email protected]om>' –