gpt4 book ai didi

html - PEAR Mail SMTP/MIME 和 HTML 格式

转载 作者:太空宇宙 更新时间:2023-11-04 13:25:05 24 4
gpt4 key购买 nike

我正在尝试设置 PEAR 以发送 SMTP 电子邮件,它工作正常。

但是,我需要通过 SMTP 发送消息,但我需要以 HTML 格式发送电子邮件 - 这可能吗。

我可以看到 PEAR 支持 MIME 和 SMTP,但我不知道是否可以将两者联系起来?

谢谢。

H.

最佳答案

有可能..

这是使用它的代码..

    $to =  $customer_email;//user mail id
$subject = "some subject";

$htmlBody="<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">

<style type=\"text/css\">

SPAN {
font-style:normal;
font-weight:normal
}

H4 {
text-align:left;
margin-bottom:0px;
margin-top:0px;
margin-right:0px;
direction:ltr
}
P {
text-align:left;
margin-bottom:12px;
margin-top:0px;
margin-right:11px;
direction:ltr;
line-height:15px
}


</style>

</head>
<body style=\"background-repeat: no-repeat\";>


<table width=\"600\" height=\"80%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">

<tr bgcolor=\"#e3f3fd\">
<td height=\"30%\">
<img src=\"$logo\" alt=\"Royal Caribbean\" width=\"70px\" height=\"60px\" style=\"margin-left:50px;text-align:center;vertical-align:top;margin-bottom:14px;margin-top:25px;margin-right:0px;direction:ltr\">
</td></tr>
<tr ><td bgcolor=\"#e3f3fd\" width=\"600\" valign=\"top\" ><div style=\"text-align:left;margin-bottom:0px;margin-left:45px;margin-top:-20px;margin-right:0px;text-indent:0px;\">
<h4 style=\"text-indent:0px;\"> <span style=\"font-family:&#39;sans-serif&#39;, &#39;HelveticaNeue Condensed&#39;, sans-serif; font-size:10pt; font-weight:bold; font-stretch:condensed; color:#265EAC\">Dear $customer,</span></h4>
<p style=\"text-indent:0px;\"> <span style=\"font-family:&#39;sans-serif&#39;, &#39;HelveticaNeue LightCond&#39;, sans-serif; font-size:10pt; font-weight:normal; font-stretch:condensed; color:#265EAC\">Thanks for your blah blah blah blah blah <br/>blah blah blah blah<a href=\"$link\">clicking here</a></span></p>

WE LOOK FORWARD TO SEE AGAIN WITH our branch </span></h4>
<h4 style=\"text-indent:0px;\"> <span style=\"font-family:&#39;sans-serif&#39;, &#39;HelveticaNeue Condensed&#39;, sans-serif; font-size:10pt; font-weight:bold; font-stretch:condensed; color:#265EAC\">
</div>
</td></tr>

<tr>
<td><img src=\"$imagefooter\" style=\"margin-top: -30px;text-align:center;vertical-align:top;margin-bottom:14px;margin-right:0px;margin-left:0px;direction:ltr\"></td>
</tr>
</table>


</body></html>";




Yii::app()->mailEx->pear(
$customer, // Recipient name
$to,
$subject,
$htmlBody
);

关于html - PEAR Mail SMTP/MIME 和 HTML 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9378566/

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