There is an example how can you add smtp relay to your php mail() function to send mail with smtp protocol.