View Full Version : no email arriving

03-31-2011, 06:31 PM
Hi, I have set up a php page and linked it to my contact form page and it all seems to go through on the the website but I am not receiving any emails.

Can anyone help?


03-31-2011, 06:42 PM
This is my code...


$emailSubject = 'contactformprocess!';
$webMaster = 'name@yahoo.co.uk';

$email = $_POST['email'];
$name = $_POST['name'];
$comments = $_POST['comments'];

$body = <<<EOD
Name: $name <br>
Email: $email <br>
Comments: $comments <br>

$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,

$theResults = <<<EOD
<title>sent message</title>
<meta http-equiv="refresh" content="3;URL=http://www.debbiesrecipesite.hostei.com/contact.html">
<style type="text/css">
body {
background-color: #06f;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #000;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
<div align="center">Your email will be answered as soon as possible!
You will return to the contact page in a few seconds !</div>
echo "$theResults";

04-01-2011, 01:54 AM
$success = mail($webMaster, $emailSubject, $body,
try just
mail($webMaster, $emailSubject, $body,

04-01-2011, 03:08 PM
post the html form

04-01-2011, 03:14 PM
@ ed

mail() returns a boolean so assigning the return value (true or false) to a variable wont have any impact on the mail functionality.

NOTE: It returns true if it was successfully prepared for mailing but not if it mailed successfully

This is valid...
$success = mail($webMaster, $emailSubject, $body, $headers);Although in the above script is not being used so pointless to use it really

04-01-2011, 05:09 PM
html for the form

<form action="http://www.myaddress.com/contact.php" method="post" name="contact1" id="contact1">
<table width="500" border="0" cellpadding="5">
<td>First name</td>
<td><input type="text" name="name" id="name" /></td>
<td><input type="text" name="surname" id="surname" /></td>
<td>Email address</td>
<td><input type="text" name="email" id="email" /></td>
<td><textarea name="comments" id="comments" cols="45" rows="5"></textarea></td>
<td><input type="reset" name="reset" id="reset" value="Reset" /></td>
<td><input type="submit" name="submit" id="submit" value="Submit" /></td>

04-02-2011, 01:15 AM
@ david thanks i just didnt see the point in it so i was grasping a bit. do you think its the absolute action thats stopping ?

<form action="http://www.myaddress.com/contact.php" method="post" name="contact1" id="contact1">

instead of <form action="contact.php" method="post" name="contact1" id="contact1">

04-03-2011, 11:35 PM
replace this

Name: $name <br>
Email: $email <br>
Comments: $comments <br>

with this

name: $name
email: $email
comments: $comments

and I am assuming your are replacing
with your actual email address...

04-04-2011, 08:11 AM
I steer away from using EOD as I'm not too keen on the practice

Try using standard variable assignments and strings