1 回答

TA貢獻1780條經驗 獲得超5個贊
你只需要用"\r\n"html<br>標簽改變
<?php
if (isset($_POST)) {
$lastName = $_POST['lastName'];
$firstName = $_POST['firstName'];
$speciality = $_POST['speciality'];
$adress = $_POST['adress'];
$phone = $_POST['phone'];
$mailFrom = $_POST['email'];
$txt = $_POST['message'];
$to = "[email protected]";
$subject = utf8_decode("Expéditeur : ".$lastName." ".$firstName);
$message = '
<html>
<head>
<title>Welcome to Website Name</title>
</head>
<body>
<p> Vous avez re?u un email de '. $lastName .'<br>'. $firstName .'<br>'. $speciality .'<br>'. $adress .'<br>'. $phone .'<br>'. $mailFrom .'<br>'. $txt .'</p>
</body>
</html>
';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: '.$mailFrom."\r\n";
$headers .= 'Reply-To: '.$mailFrom."\r\n";
mail($to, $subject, $message, $headers);
header("Location: /");
}
?>
- 1 回答
- 0 關注
- 121 瀏覽
添加回答
舉報