The problem is that it works 90%, sometimes it gives the problem.
In that case you might want to log the exact full log of the interaction with the server.
(You could log SMTP.FullResult at several places for this)
It should provide a better message about the reason why login failed.
If you also have access to the log files of the internal mail server, you can look in there too.
I don't see where you provide that error message to the user. But the chances are that the error is 'gone' from the ErrorString by then. That's why you need to log it every step of the way to catch it at the correct moment.