本文整理汇总了PHP中htmlMimeMail::setHtmlEncoding方法的典型用法代码示例。如果您正苦于以下问题:PHP htmlMimeMail::setHtmlEncoding方法的具体用法?PHP htmlMimeMail::setHtmlEncoding怎么用?PHP htmlMimeMail::setHtmlEncoding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htmlMimeMail
的用法示例。
在下文中一共展示了htmlMimeMail::setHtmlEncoding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sql
function send_Messages()
{
include_once "lib/mail.class.php";
$conf = $this->conf();
$db = new sql();
$db->connect();
$res = $db->query("select * from subs_messages where id={$this->mid}");
$data = $db->fetch_array($res);
$page = $this->page ? $this->page : 1;
$res = $db->query("select * from subs_users left join subs_subscribed on subs_users.id=subs_subscribed.sid where lid={$this->id} limit " . 10 * ($page - 1) . ",10");
if ($db->num_rows($res)) {
while ($user = $db->fetch_array($res)) {
$i++;
$text["txt"] = $data["text"];
$text["html"] = $data["html"];
if ($data["text"]) {
$txt = $this->replaceMacros($conf["text"], $text, $conf, $user);
}
if ($data["html"]) {
$html = $this->replaceMacros($conf["html"], $text, $conf, $user);
}
$mail = new htmlMimeMail();
$mail->setSubject($data["subj"]);
$mail->setFrom($conf["email_from"]);
if ($html) {
$mail->setHtmlEncoding("base64");
$mail->setHTML($html, $txt, '');
} elseif ($txt && !$html) {
$mail->setText($txt);
}
$result = $mail->send(array($user["email"]));
}
$page++;
//echo "Location: ?chid=".$this->chid."&action=send_Messages&id=".$this->id."&mid=$this->mid&page=$page;";
header("Location: ?chid=" . $this->chid . "&action=send_Messages&id=" . $this->id . "&mid={$this->mid}&page={$page}&i={$i}");
} else {
if ($this->page) {
$count = 10 * ($this->page - 2) + $this->i;
$_SESSION["warning"] = "Писем отправлено: {$count}";
$db->query("update subs_messages set date_sent=" . time() . " where id={$this->mid}");
}
header("Location: ?chid=" . $this->chid . "&action=show_Messages&id=" . $this->id . "&w=1");
}
}