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;
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 :)