SMTP设置显示错误操作超时 [英] SMTP setting show error Operation Time out
本文介绍了SMTP设置显示错误操作超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
try
{
MailMessage mail = new MailMessage();
mail.From = new System.Net.Mail.MailAddress("@gmail.com");
SmtpClient smtp = new SmtpClient();
smtp.Port = 465;
smtp.EnableSsl = true;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("@gmail.com", "");
smtp.Host = "smtp.gmail.com";
mail.To.Add(new MailAddress("@gmail.com"));
mail.IsBodyHtml = true;
string st = "This is for testing SMTP mail from GMAIL";
mail.Body = st;
smtp.Send(mail);
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
推荐答案
看看下面的链接
通过vb .net windows应用程序发送电子邮件时出错(操作超时) [< a href =http://www.codeproject.com/Questions/582062/Gettingplusanpluserrorplus-OperationplusTimedplusotarget =_ blanktitle =New Window> ^ ]
希望它有所帮助。
Have a look at the below link
Getting an error (Operation Timed out) while sending an email via vb .net windows application[^]
Hope it helps.
这篇关于SMTP设置显示错误操作超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文