I have configured a new Exchange 2016 server and I use it to send emails over a self-written .net application, using the standard MailMessage and SmtpClient. Everything works fine about 90% of the time and then suddenly without any change (neither on the server, nor on the code) this error is returned:
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM
Then some time later (could be a minute or an hour) everything works fine again, without any change on either component. Any ideas what might be causing this?