what do you have set as the SMTP server on the local page?
if you have a remote SMTP server set, it will pass the email message to the remote SMTP server to be relayed.
Here's an overview of how the email system works:
The PHP page compiles the email message, basicly the same as physical mail where the message is placed in an envelope With the To address printed on the front and the from address printed in the top left corner.
the PHP page then passes the envelope to the SMTP server. This is basically the same as placing the physical mail into the mail box.
The PHP page is no longer a part of the equation. It is now up to the SMTP server to deliver the email to the recipient.
If you are running the same code on your local testing server, and the mail is being delivered, but on the remote server it is not being delivered, the SMTP server is refusing to relay the email message for some reason. You will need to contact the host to have them look into the SMTP server error logs to determine why the email is not being relayed.