將數據發送到電子郵件時,我試圖在電子郵件中添加更多變量。在電子郵件中發佈來自PHP表單的數據
<?php
$to = "[email protected]";
$email = $_POST['email'];
$fname = $_POST['first'];
$lname = $_POST['last'];
$account = $_POST['account'];
$subject = "Safe Haven Reservation";
$message = $account;
$from = $email;
$headers = "From:" . $from;
mail($to,$subject,$fname,$lname,$account);
?>
我希望能夠添加; $ fname和$ lname添加到郵件中,我無法弄清楚要處理哪些字符。
你不正確地調用「mail」:http://php.net/manual/en/function.mail.php – andrewsi 2013-05-07 15:15:36