My ISP have blocked port 25 for sending mails from PHP, and instead have allowed port 587 or 465 to be used. how do i force php mail function to use port 587 instead of defa
If you can, try to override smtp_port setting with ini_set(). Should be something like this:
ini_set('smtp_port', 587);