C# yandex mail send error 5.5.4 Error: send AUTH command first

user1688401 picture user1688401 · Feb 22, 2017 · Viewed 12.6k times · Source

I try to send mail using C# and yandex, but I get an error:

Error 5.5.4 Error: send AUTH command first

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;

Answer

Kemal Can ÖZÇELİK picture Kemal Can ÖZÇELİK · Jul 8, 2019

I had same error and I correct it via doing some setting at mail.yandex.com (in email account)

To fix it; - Enter the mail address (mail.yandex.com) - Settings - Other Email application - Set selected POP3 setting that is all.

Note : I used 587 port and smtp.yandex.com.tr host.

Have a nice day :)