gpt4 book ai didi

电子邮件问题中的 Phpmailer 图片

转载 作者:行者123 更新时间:2023-12-02 05:13:04 27 4
gpt4 key购买 nike

我不知道为什么在 MAC OS X (Mail 6.2) 的邮件客户端中图像显示如下:

enter image description here

和其他邮件客户端,如 gmail、outlook 或 private,图像是正确的,看起来像这样:

enter image description here

PHP邮件程序

require_once 'phpmailer/class.phpmailer.php';
$mail = new PHPMailer(true);
$mail->IsSMTP();

try {
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->Host = "mail.com.mx";
$mail->Port = 587;
$mail->CharSet = "UTF-8";
$mail->Username = "soldier@mail.com.mx";
$mail->Password = "password?";
$mail->SetFrom('no-reply@mail.com.mx', 'MA Consulting');
$mail->Subject = 'Subject';
$message = '<div style="border:solid 1px #427696;font-family:Arial;width:650px">
<table style="background:#799db4;border-bottom:solid 1px #427696;width:650px; padding:5px;">
<tbody>
<tr>
<td>
<div style="padding:30px 30px 0;font-size:30px; height: 65px;">
<a style="text-decoration: none; color: #FFF;" href="iq.com.mx/iq" target="_blank">MA Consulting</a>
</div>
</td>
<td style="vertical-align:middle;text-align:right;padding-right:30px">
<img src="../media/Logo-MA.gif" width="120px" height="93px"/>
</td>
</tr>
</tbody>
</table>
</div>
<!-- more code -->';

$mail->MsgHTML($message);
$mail->AddAddress($email, $name);
$mail->Send();
} catch (phpmailerException $e) {
echo $e->errorMessage();
} catch (Exception $e) {
echo $e->getMessage();
}

最佳答案

我只是猜测,因为很难测试,但我不认为 widthheight <img> 中的属性应该包括 px .

尝试删除它们:

<img src="../media/Logo-MA.gif" width="120" height="93"/>

关于电子邮件问题中的 Phpmailer 图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15072307/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com