使用MD5质询 - 响应身份验证发送电子邮件
您好,我正在尝试使用MD5质询响应发送电子邮件,但它不能与我合作,继承人我正在尝试的代码:
System.Net.Mail.MailMessage mMsg = new System.Net.Mail.MailMessage("bshouman@gmail.com", "bshouman@gmail.com", "test", "test");
mMsg.IsBodyHtml = true;
System.Net.Mail.SmtpClient smtpC = new System.Net.Mail.SmtpClient();
smtpC.Host = "mail.***.com";
smtpC.Port = 465;
smtpC.EnableSsl = true;
smtpC.UseDefaultCredentials = false;
System.Net.NetworkCredential creds = new System.Net.NetworkCredential("sales@***.com", "***", "***.com");
smtpC.Credentials = creds.GetCredential("mail.***.com", 465, "CRAM-MD5"); ;
smtpC.Send(mMsg);
这是我得到的错误: System.IO.IOException:无法从传输连接读取数据:net_io_connectionclosed。 System.Net.Mail.Smt.Mail.Smt.Mail.Smt.Mail.Smt.Mail.Smt.Mail.Sat.Mail.Sat.Mail.Sat.Mail.Sat.Mail.Sat.Mail上的System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte []缓冲区,Int32偏移量,Int32读取,布尔值readLine)处于System.Net.Mail.SmtpReplyReaderFactory的System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader调用者,布尔值oneLine) System.Net.Mail.SmtpClient.GetConnection上System.Net.Mail.SmtpTransport.GetConnection(字符串主机,Int32端口)的System.Net.Mail.SmtpConnection.GetConnection(字符串主机,Int32端口)上的.ReadLine(SmtpReplyReader调用者) ()在System.Net.Mail.SmtpClient.Send(MailMessage消息)