服務器不支持安全連接
Server does not support secure connections. 服務器不支持安全連接
下面是原碼:
private static void sendMail(string name, string email)
{
string smtpServer = "ksmail01.服务器
int smtpPort = 25;//端口
string userAccount = "******** ";//用户名
string userPassword = "***************";//密码
string userName = "系統管理員";//发件人名称
string EmailAddress = "Missyatem@发件邮箱
string strto = email;//目的邮箱
string strSubject = "dd";//主题
string strBody = "ss";
client = new SmtpClient(smtpServer, smtpPort);
client.EnableSsl = true;
client.UseDefaultCredentials = true;
client.Credentials = new (userAccount, userPassword);
client.DeliveryMethod =
MailAddress fromEmal = new MailAddress(EmailAddress, userName);
MailAddress toEmail = new MailAddress(strto);
message = new MailMessage(fromEmal, toEmail);
message.Subject = strSubject;
message.Body = strBody;
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = true;
client.Send(message);
}
請大路過的大俠賜教 ,