You cant add authentication by editing the code directly.
Edit the universal Email server behavior. Click on the Envelope icon, and change the mail object to use Pear Mail for SMTP
in the pear mail settings, you an enable authentication and add the user name / password.