您的意思是在HTML版本的同时发送纯文本版本吗?
如果是我发现的this page 有助于设置:
关键在于:
//create a boundary for the email. This
$boundary = uniqid(\'np\');
//headers - specify your from email address and name here
//and specify the boundary for the email
$headers = "MIME-Version: 1.0\\r\\n";
$headers .= "From: Your Name \\r\\n";
$headers .= "To: ".$email."\\r\\n";
$headers .= "Content-Type: multipart/alternative;boundary=" . $boundary . "\\r\\n";
//Plain text body
$message .= "Hello,\\nThis is a text email, the text/plain version.
\\n\\nRegards,\\nYour Name";
$message .= "\\r\\n\\r\\n--" . $boundary . "\\r\\n";
$message .= "Content-type: text/html;charset=utf-8\\r\\n\\r\\n";
//Html body
$message .= "
Hello,
This is the html version.
Regards,
Your Name";
$message .= "\\r\\n\\r\\n--" . $boundary . "--";
希望这有帮助