我假设将文本/html 格式收入电子邮件的内容类型设置为客户端/用户机器的默认字体样式和大小。用户 Pear Mail 我将如何添加内容类型。我发送的所有示例仅显示使用 mime 附件添加内容类型。
另外,如果有另一种方法可以使传入的电子邮件默认为用户邮件客户端的字体样式和大小,我想知道。
想补充
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
当前邮件代码
$from = "sys@test.com";
$to = $SendTo;
$subject = "Contact : " . $uxGlobalLocation;
$body = $Bodycopy;
$host = "mail.set.co";
$username = "donotreply@set.co";
$password = "empty00";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
header ('Location: /');
exit();
}
编辑可能的答案
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject,
'Content-Type' => 'text/html; charset=iso-8859-1',
'MIME-Version' => '1.0');