PDA

View Full Version : PHP Script (Form to Email) help!


Dixie Chamberlain
02-16-2010, 12:36 AM
Here's my contact page.

http://ultramegamanx.uuuq.com/contact.html

I wrote a php script for the form and I did everything right (so far), but when I test out the submission, I never receive an email. Does anyone know what I'm doing wrong?

Here's my script:

<?php

/* Email Variables */

$emailSubject = 'contactformprocess!';
$webMaster = 'ultramegamanx@gmail.com';


/* Data Variables */

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



$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Message: $message <br>
EOD;

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


/* Results rendered as HTML */

$theResults = <<<EOD
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Thank you for your feedback!</title>
</head>

<body>
<p>Your message has been sent to the webmaster of http://ultramegamanx.uuuq.com</p>
<p>Click <a href="contact.html">here</a> to go back.</p>
</body>
</html>
EOD;
echo "$theResults";
?>

edbr
02-16-2010, 01:16 AM
what triggers $success?