当客户购买商品时,该按钮应该向网站所有者发送电子邮件。这是我目前的代码:
SmtpClient smtpClient = new SmtpClient("smtpout.europe.secureserver.net", 80);
smtpClient.Credentials = new System.Net.NetworkCredential("info@furkantellioglu.com ", "Password");
smtpClient.UseDefaultCredentials = true;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.EnableSsl = true;
MailMessage mail = new MailMessage();
mail.Body = "Bekleyen Siparişleriniz Bulunmakta Lütfen Kontrol Ediniz.";
mail.Subject = "Dermabon Web Satış";
mail.IsBodyHtml = true;
mail.From = new MailAddress("info@furkantellioglu.com", "Sipariş");
mail.To.Add(new MailAddress("info@furkantellioglu.com"));
mail.CC.Add(new MailAddress("f.tellioglu@gmail.com"));
smtpClient.Send(mail);
但是当我运行它时,我收到了这个错误:
An exception of type 'System.Net.Mail.SmtpException' occurred in System.dll but was not handled in user code
Additional information: Sunucu güvenli bağlantıları desteklemiyor.
关于这意味着什么想法?
答案 0 :(得分:0)
错误消息表示服务器不支持安全连接。您正在使用enable ssl但发送到端口80,因此可能存在冲突。
答案 1 :(得分:0)
似乎是一个端口错误,请尝试使用更改
EnableSsl=false;
和/或UseDefaultCredentials = true;
或使用port 25
答案 2 :(得分:0)