2011-09-25 72 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>' –