我正在使用 phpmailer 发送 html 模板。不幸的是,某些电子邮件客户端(例如雷鸟)上没有显示外部图像(不是客户端。未标记为垃圾邮件和启用图像。其他邮件也可以显示图像)
phpmailer 部分:
$mail = new PHPMailer;
$mail->CharSet = 'utf-8';
$mail->SetLanguage('de', $path.'email/');
$body = file_get_contents($path.'email/email-template.html');
$replacer = array('{{1}}', '{{2}}', '{{3}}');
$toreplace = array($1, $2, $3);
$body = str_replace($replacer, $toreplace, $body);
$mail->From = 'noreply@host.com';
$mail->FromName = 'noreply@host';
$address = $empfaenger;
$mail->AddAddress($address, $name);
$mail->Subject = $betreff;
$mail->IsHTML(true);
$mail->Body = $body;
html模板:
...
img src="http://host.com/email/image.png">
...
style="background-image:url(http://host.com/email/image2.png);background-repeat:repeat-x;background-position:top left;"
...
我究竟做错了什么?