PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
kevspad
Forum Newbie
Posts: 5 Joined: Sat Jun 17, 2006 4:47 pm
Post
by kevspad » Sat Jun 17, 2006 5:02 pm
im trying to get a confirmation and recap page to display sending an email to the user and then one to me the code completes and runs but i do not get the email.
can anyone help?
Code: Select all
<?php
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$requirements = $_POST['requirements'];
$telephone = $_POST['telephone'];
$time = $_POST['time'];
echo "Thanks ". $firstname . " " . $surname . "<br />";
echo "<br />";
echo "Your order has been sent and will be processed we will try and call you <br />";
echo "at your requested time if we however miss your requested time we will keep trying <br />";
echo "<br />";
echo "To recap your requirements are: ". $requirements .".<br />";
echo "<br />";
echo "We will try calling you on " . $telephone . " at about " . $time . "<br />";
echo "<br />";
echo "<br />";
echo "Thank you for ordering from Dodpen Farm <br />";
echo "<br />";
echo "Dodpen Farm<br />";
echo "Fishpond <br />";
echo "Bridport <br />";
echo "DT6 6NW <br />";
echo "Tel:01297 678393<br />";
echo "<br />";
echo "www.dodpenfarm.co.uk <br />";
$sendTo = "kev@dodpenfarm.co.uk";
$subject = "Dodpen Farm";
$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] ."\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-path: " . $_POST["email"];
$message = "requirements" . $_POST['requirements'];
$message = "Telephone" . $_POST['telephone']. " at ". $_POST['time'];
?>
any help much appreciated.
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Sat Jun 17, 2006 5:08 pm
Is it being blocked as spam?
Where do you call mail() ? I don't see it in the code you posted.
kevspad
Forum Newbie
Posts: 5 Joined: Sat Jun 17, 2006 4:47 pm
Post
by kevspad » Sat Jun 17, 2006 5:30 pm
No there not in spam checked that one first off
Not sure about the second part that u mentioned?
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Confirmation</title>
</head>
<body>
<?php
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$requirements = $_POST['requirements'];
$telephone = $_POST['telephone'];
$time = $_POST['time'];
echo "Thanks ". $firstname . " " . $surname . "<br />";
echo "<br />";
echo "Your order has been sent and will be processed we will try and call you <br />";
echo "at your requested time if we however miss your requested time we will keep trying <br />";
echo "<br />";
echo "To recap your requirements are: ". $requirements .".<br />";
echo "<br />";
echo "We will try calling you on " . $telephone . " at about " . $time . "<br />";
echo "<br />";
echo "<br />";
echo "Thank you for ordering from Dodpen Farm <br />";
echo "<br />";
echo "Dodpen Farm<br />";
echo "Fishpond <br />";
echo "Bridport <br />";
echo "DT6 6NW <br />";
echo "Tel:01297 678393<br />";
echo "<br />";
echo "www.dodpenfarm.co.uk <br />";
$sendTo = "kev@dodpenfarm.co.uk";
$subject = "Dodpen Farm";
$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] ."\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-path: " . $_POST["email"];
$message = "requirements" . $_POST['requirements'];
$message = "Telephone" . $_POST['telephone']. " at ". $_POST['time'];
?>
</body>
</html>
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Sat Jun 17, 2006 5:47 pm
you need to call the mail() function to send mail.. in your code you are never calling it
kevspad
Forum Newbie
Posts: 5 Joined: Sat Jun 17, 2006 4:47 pm
Post
by kevspad » Sun Jun 18, 2006 6:13 am
ok an update
Done some more to the code and now receive an email but not receiving anything in the message body can anyone help?
Code: Select all
ini_set("SMTP","mail.kevspad.co.uk");
ini_set("sendmail_from","kev@kevspad.co.uk");
mail($sendTo = "kev@kevspad.co.uk",$subject = "Dodpen Farm",$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n");
$message = "requirements" . $_POST['requirements'];
$message = "Telephone" . $_POST['telephone']. " at ". $_POST['time'];
tecktalkcm0391
DevNet Resident
Posts: 1030 Joined: Fri May 26, 2006 9:25 am
Location: Florida
Post
by tecktalkcm0391 » Sun Jun 18, 2006 7:40 am
kevspad wrote:
Code: Select all
ini_set("SMTP","mail.kevspad.co.uk");
ini_set("sendmail_from","kev@kevspad.co.uk");
mail($sendTo = "kev@kevspad.co.uk",$subject = "Dodpen Farm",$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n");
$message = "requirements" . $_POST['requirements'];
$message = "Telephone" . $_POST['telephone']. " at ". $_POST['time'];
Try:
Code: Select all
ini_set("SMTP","mail.kevspad.co.uk");
ini_set("sendmail_from","kev@kevspad.co.uk");
$message = "requirements" . $_POST['requirements'];
// Notice the " . " after the seond message . This appends the data to the previous variable of $message
$message. = "Telephone" . $_POST['telephone']. " at ". $_POST['time'];
// List variables to send here:
$subject = "Dodpen Farm";
$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n";
$sendTo = "kev@kevspad.co.uk";
mail($sendTo, $subject, $message, $headers);