Mailform help
Posted: Thu Jul 23, 2009 9:28 am
For some reason the line breaks are not processed in the email.
This outputs in the email as
I am taking over a web technicians role, and am a relative newbie.
Code: Select all
<?php
ini_set("sendmail_from", "example@btinternet.com");
$mailfrom = "example@btinternet.com";
$mailto = "example@btinternet.com";
$thanks = "thanks.php";
foreach ($_POST as $key=>$value)
{
$mailtext .= '<b>' .$key. ':</b> ' .$value.'<br> ';
}
$headers = 'From: '.$mailfrom.'
Reply-to: '.$mailfrom.'
Return-path: '.$mailfrom.'
Content-type: text/html
';
mail($mailto, " Site enquiry", $mailtext, $headers);
header("location: $thanks");
?>Code: Select all
<b>name:</b> test<br> <b>address:</b> test<br> <b>email:</b> est<br> <b>telephone:</b> dsates<br> <b>spamcheck:</b> ok<br> <b>enquiry:</b> test<br>