Hello People I have written a code to send email using........php.
At first it seems like it is pretty simple to send email just using the mail () function. But i am still unable to send the mail .
The code is as follows:
<?
function send_mail($myname, $myemail, $contactname, $contactemail, $subject, $message) {
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$myname."\" <".$myemail.">\n";
return(mail("\"".$contactname."\" <".$contactemail.">", $subject, $message, $headers));
}
if (send_mail("Company", "person@company.com", "Customer", "bindaas_guyforyou@yahoo.com", "This is a test", "This is a test\nOne two three four\nBlah blah blah\nThis is a test!")) {
print "SENT!";
} else {
print "FAILED!";
}
?>
It prints the message sent but i could not see the mail landin in my mail box. I have used yahoo, hotmail and gmail account to send the mail , but of no use
the php settings of my webhost are as follows:
sendmail_from me@localhost.com me@localhost.com
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
SMTP localhost localhost
smtp_port 25 25
Please help me by pointing out where i am wrong.
Thanks in advance.. everybody