本文整理汇总了PHP中SMTP::SmtpMail方法的典型用法代码示例。如果您正苦于以下问题:PHP SMTP::SmtpMail方法的具体用法?PHP SMTP::SmtpMail怎么用?PHP SMTP::SmtpMail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMTP
的用法示例。
在下文中一共展示了SMTP::SmtpMail方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
}
}
if ($mass) {
while (!$plproxy->val("SELECT COUNT(*) FROM messages(?) WHERE id = ?", $sender['uid'], $message_id)) {
echo "Wait PGQ (10 seconds)...\n";
sleep(10);
}
$res = $plproxy->query("SELECT * FROM messages_zeros_userdata(?, ?)", $sender['uid'], $message_id);
} else {
$res = $master->query($sql);
}
echo "Send email messages\n";
$count = 0;
$smtp = new SMTP();
if (!$smtp->Connect()) {
die("Don't connect to SMTP\n");
}
while ($user = pg_fetch_assoc($res)) {
if (empty($user['email']) || !is_null($eSubscr) && substr($user['subscr'], $eSubscr, 1) == '0') {
continue;
}
$smtp->recipient = $user['uname'] . " " . $user['usurname'] . " [" . $user['login'] . "] <" . $user['email'] . ">";
$smtp->subject = preg_replace("/\\{\\{([-_A-Za-z0-9]+)\\}\\}/e", "\$user['\\1']", $eSubject);
$smtp->message = preg_replace("/\\{\\{([-_A-Za-z0-9]+)\\}\\}/e", "\$user['\\1']", $eMessage);
if ($count > 0 && $count % $printStatus == 0) {
echo "Working... {$count} emails sended\n";
}
$smtp->SmtpMail('text/html');
$count++;
}
echo "OK. Total: {$count} users\n";