PHP Classes

Mail not sending

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Mail not sending  
Subject:Mail not sending
Summary:Hi guys, I wrote a code for sending email using mail() function,
Messages:2
Author:Matiluko Opeyemi
Date:2009-10-02 23:56:21
Update:2009-10-04 16:16:13
 

  1. Mail not sending   Reply   Report abuse  
Picture of Matiluko Opeyemi 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?

There is 1 reply in this thread, which is not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.