If you use smtp.yandex.ru server for sending emails in .Net application via standard System.Net.Mail.SmtpClient class then starting from recent time you could faced with the problem that emails are not sent anymore. The problem is caused by the change in Yandex SMTP configuration: starting from 16 September 2014 it works only via SSL. According to information from company’s site the following settings should be used:
Enable SSL: yes
However if you will use these settings in .Net application, emails still won’t work (you will get timeout exception):
In order to make it work we still need to use standard SMTP port 25 (not 465 as mentioned in mail clients settings page in Yandex help) and set EnableSsl = true:
Probably this behavior is related with realization of “explicit SSL” mode in SmtpClient when connection is established via 25 port in non-encrypted form and then switches to secure mode. Anyway as it is not obvious solution I decided to post it here, probably it will help someone.