请大虾帮忙!:stmp 我在做邮件发送 遇到与服务器的传输连接失败。
这是我的代码:
protected void send_message(object sender, System.EventArgs e)
{
System.Web.Mail.MailMessage mailMessage = new System.Web.Mail.MailMessage();
mailMessage.From = "hanhans@21cn.com";
mailMessage.To = "hanhans@21cn.com";
mailMessage.Subject = "Email Subject";
mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text;
System.Web.Mail.SmtpMail.SmtpServer = "smtp.sohu.com";
System.Web.Mail.SmtpMail.Send(mailMessage);
}
异常详细信息: System.Runtime.InteropServices.COMException: 与服务器的传输连接失败。
谢谢!!