mail php

I’m using the following php to attempt to send mail both on my local host and on 000webhost i’m seeing “mail sent successfully” but i’ve tried chaning the $to to various different emails. Ranging from AOL to yahoo to gmail. However none of them seem to work. Thanks in advance for your help.

<?php $to= '[email protected]'; $subject='test'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $message='testing sendmail.exe. '; if(mail($to,$subject,$message,$headers)) { echo "mail sent successfully"; } else { echo "mail not sent..error"; } ?>

Check this: http://www.quackit.com/php/tutorial/php_mail_configuration.cfm

Sponsor our Newsletter | Privacy Policy | Terms of Service