我有以下代码行:
$from = "[email protected]";
$headers = "From:" . $from;
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
我需要MIME类型,因为我正在使用html文件的file_get_contents,我的问题是在标题下显示为“ [email protected]:1.0”,我只想说“ [email protected] “如何从标题中显示的中取出MIME类型?
谢谢
只需在\r\n
标头之后也添加From:
。
$headers = "From:" . $from . "\r\n";
$to = "[email protected]";
$subject = "New Agent Record";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= "Reply-To: New Agent Record <[email protected]>\r\n";
$headers .= "Return-Path:New Agent Record <[email protected]>\r\n";
$headers .= "From: New Agent Record <[email protected]>\r\n";
$headers .= "Organization: New Agent Record\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n";