不从表单发送电子邮件

时间:2013-08-21 19:17:47

标签: php email

我只是想创建一个脚本,将表单中的结果发送给我。它正在工作,但现在甚至没有发送电子邮件。谁能发现原因?谢谢!!我经历过这100次,我看不出有什么问题......

`

/* Subject and Email Variables */

$emailSubject = 'Membership Submission from Form';
$webMaster = 'testemail@gmail.com';

/* Gathering Data Variables */

$nameField = $_POST['name'];
$membershipField = $_POST['membership'];
$addressField = $_POST['address'];
$cityField = $_POST['city'];
$provinceField = $_POST['province'];
$postalcodeField = $_POST['postalcode'];
$telhomeField = $_POST['telhome'];
$telcellField = $_POST['telcell'];
$telofficeField = $_POST['teloffice'];
$emailField = $_POST['email'];
$commentsField = $_POST['comments'];

$body = <<<EOD
Name: $name <br>
Membership Type: $membership <br>
Address: $address <br>
City: $city <br>
Province: $province <br>
Postal Code: $postalcode <br>
Tel Home: $telhome <br>
Tel Cell: $telcell <br>
Tel Office: $teloffice <br>
Email: $email <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

EOD;
echo "$theResults";


?>` 

0 个答案:

没有答案