Matiluko Opeyemi - 2009-10-03 01:38:13
Hi guys,
I wrote a code for sending email using mail() function, it worked on a domain and didn't work on another domain
The code is below:
<?
if (isset($_POST["submit"]) && isset($_POST["mySubmit"]) && ($_POST["mySubmit"] == "Send")) {echo'Am in';
$to="info@pukkalogistics.com, opmat01@yahoo.com";
$subject= $_POST["subject"];
// Get time from server.
$time=date("d/m/Y");
$mail_from="From: " . $_POST["name"] . ' <'. $_POST["email"] . "> n";
$mail_from .="Content-Type: text/html; charset=utf-8 n";
$message="
Contact on : $time
Name : " . $_POST["name"] . "\n
Email : " . $_POST["email"] . "\n
Message : " . $_POST["msg"] . "\n
";
// Send email.
if (mail($to,$subject,$message,$mail_from)){echo'ok';
$formErr = "Your Message has been sent";
$to = $_POST["name"] . " <" . $_POST["email"] . ">";
$mail_from="From: Pukka Logistics and Support Services Ltd <info@pukkalogistics.com> n";
$mail_from .="Content-Type: text/html; charset=utf-8 n";
$subject = "Pukka Logistics";
$message = "
Dear " . $_POST["name"] . ",
I am glad inform you that you request(s) and/or comment(s), submitted to Pukka Logistics and Support Services Ltd on our website, has been received and will be processed. The details of your message is as follows: \n" . $message . "We will get back to you if need be as soon as possible.\n
Thank you.
Webmaster
www.pukkalogistics.com";
//send mail to client
mail($to,$subject,$message,$mail_from);
}
}
else{
$formErr = "An Error Occured while trying to send the <br/>Message, Please try sending Later.";
}
?>
can anyone figure out the problem?