PHP is server side, so the client can only send email through the server's mailserver, not his own local mailserver.
A quick way to get the server's mailhost is to take the domain name and put 'smtp' or 'mail' in front of it.
Otherwise you can query the DNS to get the MX record.