PHP メーラー スクリプトがあり、そこに HTML テーブルを追加しようとしていますが、実行するとスクリプトが機能しなくなります。
これがPHPメーラースクリプトです
<?php
// Insert your email/web addresses and correct paths
$mailto = 'adil@*******.co.uk' ;
$from = "web@city.com" ;
$subject = "Query from ******* 2012";
$headers = "From: ******* Website";
$formurl = "http://*******.co.uk/citycoaches3/formmail.php" ;
$errorurl = "http://*******.co.uk/citycoaches3/error.php" ;
$thankyouurl = "http://*******.co.uk/citycoaches3/thankyou.php" ;
// Place Your Form info here...
$pickuppoint = ($_POST['pickuppoint']);
$destination = ($_POST['destination']);
// Check If Empty
// Add more Validation/Cleaning here...
// Place your Corresponding info here...
$message =
"Pick Point: $pickuppoint\n\n" .
"Destination: $destination\n\n" .
"noppl: $noppl\n\n"
;
// Leave Alone
mail($mailto, $from, $message);
header( "Location: $thankyouurl" );
exit ;
?>
これに関するヘルプをいただければ幸いです。
ここに私が試したものがあります
<?php
$fromAddr = 'adil@********.co.uk'; // the address to show in From field.
$recipientAddr = 'quotes@********.co.uk';
$subjectStr = '[Quick] Query From ********';
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$forward = 1;
$formurl = "http://www.********.co.uk/formmail.php" ;
$errorurl = "http://www.********.co.uk/error.php" ;
$thankyouurl = "http://www.********.co.uk/thankyou.php" ;
header("location:thankyou.php");
$mailBodyText = <<<HHHHHHHHHHHHHH
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Thank You</title>
</head>
<body>
<img src="http://********.co.uk/images/mailsig.png" /> \n\n<br />
<span style="color:#900; font-size:18px;">Below is the result submitted from <strong>[Quick Quote] ******** Website</strong>. It was submitted on <strong>$date at $time</strong>.\n\n</span>
<p><table width="600" border="1" cellpadding="5px">
<tr>
<td><b>Pickup Date:</b> </td>
<td>{$_POST['date']}<br></td>
</tr>
<tr>
<td><b>Pickup Time:</b> </td>
<td>{$_POST['PickupTime-Hours']}:{$_POST['PickupTime-Mins']}<br></td>
</tr>
<tr>
<td><b>Pickup Point:</b> </td>
<td>{$_POST['PickUp-Point']}<br></td>
</tr>
<tr>
<td><b>Destination:</b> </td>
<td>{$_POST['Destination']}<br></td></tr>
<tr>
<td><b>No. Of People:</b> </td>
<td>{$_POST['No-of-Persons']}<br></td>
</tr>
<tr>
<td><b>Journey Type:</b> </td>
<td>{$_POST['JourneyType']}<br></td>
</tr>
<tr>
<tr>
<td><b>Return Date:</b> </td>
<td>{$_POST['returnDate']}<br></td>
</tr>
<tr>
<td><b>Return Time:</b> </td>
<td>{$_POST['returnTime-Hours']}{$_POST['returnTime-Mins']}<br></td>
</tr>
<tr>
<tr>
<td><b>Vehicle Type:</b> </td>
<td>{$_POST['type']}<br></td>
</tr>
<tr>
<tr>
<td><b>Full Name:</b> </td>
<td>{$_POST['Full-Name']}<br></td>
</tr>
<tr>
<tr>
<td><b>Tel / Mobile:</b> </td>
<td>{$_POST['Tel-Mobile']}<br></td>
</tr>
<tr>
<td><b>Email:</b> </td>
<td>{$_POST['Email']}<br></td>
</tr>
<tr>
</table>
</p>
</body>
</html>
HHHHHHHHHHHHHH;
$headers= <<<TTTTTTTTTTTT
From: $fromAddr
MIME-Version: 1.0
Content-Type: text/html;
TTTTTTTTTTTT;
mail($mailto, $from, $message,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep );
header( "Location: $thankyouurl" );
exit ;
?>
それでもなぜかうまくいきません。
更新は次のとおりです。
取り外した後
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" .
メールはなんとか受信できましたが、$message にあるコード全体が貼り付けられていました。