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 = "mymail@mymail.com";
$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 关注
- 91 浏览
添加回答
举报