How to resolve SMTP connection failing problem with code 535?
I had this very same problem with SMTP and couldn't find a solution with the configuration, although I didn't change the code you mention.
I found a workaround by choosing mail() instead of SMTP in Administer>system settings>outbound email, since when I've had no problems.  The default option should apparently work fine on linux systems, if that is appropriate.