PHPmailer强制Microsoft Exchange呈现为html

时间:2014-05-06 04:43:49

标签: php html exchange-server html-email phpmailer

按照脚本成功向大多数电子邮件客户端发送xls附加电子邮件。但是,Exchange以纯文本形式接收它,这使得xls不可读。

$mail = new PHPMailer(true);
$mail->CharSet = 'UTF-8';

$mail->AddAddress('example@example.com.au', 'example name');
$mail->SetFrom('example@example.com.au', 'example name');

$mail->ContentType = 'text/html';
$mail->IsHTML(true);  

$mail->Subject = 'example subject';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; 

$mail->MsgHTML(file_get_contents('contents.html'));
$mail->AddAttachment($newOrdersReport);      // attachment

$mail->Send();

我做了一些研究,但是找不到关于Microsoft Exchange的任何主题。知道怎么做到这一点?

以下是Exchange的标题代码段:

--b1_dbc2cccc876da210fd56ae7a2601e692
Content-Type: multipart/alternative;
        boundary="b2_dbc2cccc876da210fd56ae7a2601e692"

--b2_dbc2cccc876da210fd56ae7a2601e692
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

To view the message, please use an HTML compatible email viewer!


--b2_dbc2cccc876da210fd56ae7a2601e692
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

0 个答案:

没有答案