Check out your php.ini, you can set these values there.
Here's the description in the php manual:
http://php.net/manual/en/mail.configuration.php
If you want to use several different SMTP servers in your application, I recommend using a "bigger" mailing framework, p.e. Swiftmailer