...

View Full Version : PHP Help- receiving email with no form results



webnewbie74
05-18-2011, 04:04 AM
<?php

/* Subject and Email Variables */

$emailSubject = 'Web Enquiry';
$webMaster = 'xxxxxxxxxx@hotmail.com';

/* Gathering data Variables*/

$email = $_POST['name'];
$email = $_POST['phone'];
$email = $_POST['mobile'];
$email = $_POST['email'];
$email = $_POST['suburb'];
$email = $_POST['time'];
$email = $_POST['subject'];
$email = $_POST['source'];
$email = $_POST['comments'];

$body = <<<EOD
<br><hr><br>
Name: $name <br>
Phone: $phone <br>
Mobile: $mobile <br>
Email: $email <br>
Surburb: $suburb <br>
Time: $time <br>
Subject: $subject <br>
Source: $source <br>
Comments : $comments <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>
<title>JakesWorks - travel made easy-Homepage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
}
-->
</style>
</head>

<div>
<div align="left">Thank you for your interest! Your email will be answered very soon!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";

?>

bullant
05-18-2011, 04:15 AM
Looks like you just need to do some Basic Debugging 101 (http://www.codingforums.com/showthread.php?p=1082858#post1082858) to find your errors, some of which are really obvious

mark1976
05-18-2011, 05:06 AM
$text="your Text";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Admin <admin@x.com>' . "\r\n";
$body="User Contacted :"."<p><br> ".$text;
$ret=mail('sender@gmail.com',"User Contact",$text,$headers);

You can use above script, this is very simple. I have tested this and worked without giving any issues

Horologe
05-18-2011, 04:47 PM
/* Gathering data Variables*/

$email = $_POST['name'];
$email = $_POST['phone'];
$email = $_POST['mobile'];
$email = $_POST['email'];
$email = $_POST['suburb'];
$email = $_POST['time'];
$email = $_POST['subject'];
$email = $_POST['source'];
$email = $_POST['comments'];

k1L0VoLt
05-20-2011, 03:51 AM
Looks like the dreaded "cut-and-paste" gremlin at work here



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum