Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Email Yandex smtp设置与ssl_Email_Web Config_Smtp_Sendmail - Fatal编程技术网

Email Yandex smtp设置与ssl

Email Yandex smtp设置与ssl,email,web-config,smtp,sendmail,Email,Web Config,Smtp,Sendmail,我可以通过enableSsl=false和25端口发送电子邮件。但对于自己的领域来说,这还不够 此设置中有什么错误或缺失 <system.net> <mailSettings> <smtp deliveryMethod="Network" from="Name"> <network host="smtp.yandex.ru" port= "465 " enableSsl="true" userName="norep

我可以通过enableSsl=false和25端口发送电子邮件。但对于自己的领域来说,这还不够

此设置中有什么错误或缺失

<system.net>
    <mailSettings>
      <smtp  deliveryMethod="Network" from="Name">
        <network  host="smtp.yandex.ru" port= "465 " enableSsl="true" userName="noreply@domain.com" password="***" />
      </smtp>
    </mailSettings>
  </system.net>

端口25似乎已经不工作了。您可以将端口587与SmtpClient和yandex mail一起使用。

端口25似乎还不能工作。您可以将端口587与SmtpClient和yandex mail一起使用

using (MailMessage mm = new MailMessage("Name <from@yandex.ru>", "to@site.com")){
    mm.Subject = "Mail Subject";
    mm.Body = "Mail Body";
    mm.IsBodyHtml = false;
    using (SmtpClient sc = new SmtpClient("smtp.yandex.ru", 25)){
        sc.EnableSsl = true;
        sc.DeliveryMethod = SmtpDeliveryMethod.Network;
        sc.UseDefaultCredentials = false;
        sc.Credentials = new NetworkCredential("from@yandex.ru", "YandexPassword");
        sc.Send(mm);
    }
}