C#yandex邮件发送错误5.5.4错误:首先发送AUTH命令 [英] C# yandex mail send error 5.5.4 Error: send AUTH command first
问题描述
我尝试使用C#和yandex发送邮件,但出现错误:
I try to send mail using C# and yandex, but I get an error:
错误5.5.4错误:首先发送AUTH命令
Error 5.5.4 Error: send AUTH command first
这是我的代码.我尝试使用不同的端口(587、465 ..)和SMTP主机(smtp.yandex.com.tr,smtp.yandex.com,smtp.yandex.ru ...),但在所有尝试中都遇到相同的错误./p>
Here is my code. I try with different ports (587, 465..) and SMTP hosts (smtp.yandex.com.tr, smtp.yandex.com, smtp.yandex.ru...) but I get the same error for all attempts.
SmtpClient sc = new SmtpClient("smtp.yandex.com.tr", 587);
//sc.Port = 587;
//sc.Host = "smtp.yandex.com";
sc.EnableSsl = false;
sc.Credentials = new System.Net.NetworkCredential(System.Configuration.ConfigurationManager.AppSettings["Email"].ToString(),
System.Configuration.ConfigurationManager.AppSettings["Sifre"].ToString());
sc.UseDefaultCredentials = false;
sc.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
推荐答案
在没有SSL的情况下,Yandex Mail不支持连接(根据 https://yandex.com/support/mail/mail-clients.xml ).尝试将EnableSsl
设置为true并使用主机:smtp.yandex.com
,端口:465.如果不起作用,请尝试端口25
Yandex Mail doesn't support connection without SSL (according to https://yandex.com/support/mail/mail-clients.xml). Try to set EnableSsl
to true and use host: smtp.yandex.com
, port: 465. If it will not work - try port 25
这篇关于C#yandex邮件发送错误5.5.4错误:首先发送AUTH命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!