代码如下。我希望它分隔 [From: xxxxxx] 部分,以便正文/消息的其余部分出现在不同的行上。
<?php
$name = $_POST["name"];
$email = $_POST["email"];
$message = $_POST["message"];
$recipient = "me@christianselig.com";
$subject = "Message From Website";
$body = "[From: " . $name . "]\n\n" . $message;
$headers = "From: " . $email . "\r\n";
$headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";
$success = mail($recipient, $subject, $body, $headers);
echo $success;
?>