Forum Moderators: coopster

Message Too Old, No Replies

How can I determine if my email is sent?

PHP email success/failure troubleshooting

         

sirbethell

3:13 pm on Sep 25, 2010 (gmt 0)

10+ Year Member




System: The following 2 messages were cut out of thread at: http://www.webmasterworld.com/php/4203532.htm [webmasterworld.com] by coopster - 5:04 am on Oct 5, 2010 (utc -6)


Hi. I am having trouble setting the .php file to work with my contact form on my website. my website is www.christophersdesign.com. here you can see the contact form that I am talking about. Please, can anyone help me with the code/script to set-up this .php file? I just can't get it to send emails to my email address. it says that it is sent on the screen but, I don't get any emails. Please, I need help with this. Thanks in advance.

sirbethell

3:29 pm on Sep 25, 2010 (gmt 0)

10+ Year Member



also, here is the .php file content....

<?php

/* Subject and Email Variables */

$webMaster = 'info@gmail.com';

/* Gathering Data Variables */
$nameField = $_POST['enter your name:'];
$emailField = $_POST['enter your e-mail:'];
$phoneField = $_POST['enter your phone:'];
$commentsField = $_POST['ENTER YOUR MESSAGE:'];

$body = <<<EOD
<br><hr><br>
enter your name: $name <br>
enter your e-mail: $email <br>
enter your phone: $phone <br>
ENTER YOUR MESSAGE: $message <BR>
EOD;

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

/* Results rendered as HTML */

$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="3;URL=http://www.christophersdesign.com/index-5.html">
<style type="text/css">
<!--
body {
background-color: #444;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #fec001;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
}

-->
</style>
</head>
<div align="center">Your email was sent successfully. You will now
return to Christophers Design Studio in a few seconds !</div>
</div>
</body>
</html>
EOD;
echo "$theResults";

?>

can someone tell me what I am doing wrong here please?

coopster

11:06 am on Oct 5, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, sirbethell.

Are you checking the results of the value being returned by the PHP mail() function to see if the mail was sent successfully?