未使用smtp客户端线程创建gmail重播

时间:2018-09-29 05:04:07

标签: c# asp.net-mvc email gmail

我正在尝试使用smtp客户端发送重播电子邮件,已成功发送重播,但未为邮件创建线程,我需要在以下重播中查看此链接https://ibb.co/drSCMp

SmtpClient client = new SmtpClient();

client.Port = 587;
client.Host = "smtp.gmail.com";
client.EnableSsl = true;
client.Timeout = 10000;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Credentials = new 
System.Net.NetworkCredential("username", "password");

MailMessage mm = new MailMessage("username", "recieverusername, "Re:subject", "Replay From c#");
mm.Headers.Add("In-Reply-To", "<messageid>");
mm.Headers.Add("References", "<messageid>");
mm.BodyEncoding = UTF8Encoding.UTF8;
mm.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;

client.Send(mm); 

0 个答案:

没有答案