本文整理汇总了PHP中ET::first方法的典型用法代码示例。如果您正苦于以下问题:PHP ET::first方法的具体用法?PHP ET::first怎么用?PHP ET::first使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ET
的用法示例。
在下文中一共展示了ET::first方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendEmail
/**
* Send an email with proper headers.
*
* @param string $to The address to send the email to.
* @param string $subject The subject of the email.
* @param string $body The body of the email.
* @return bool Whether or not the mailing succeeded.
*
* @package esoTalk
*/
function sendEmail($to, $subject, $body)
{
try {
$phpmailer = PATH_LIBRARY . '/vendor/class.phpmailer.php';
require_once $phpmailer;
$mail = new PHPMailer(true);
if ($return = ET::first("sendEmailBefore", array($mail, &$to, &$subject, &$body))) {
return $return;
}
$mail->CharSet = 'UTF-8';
$mail->IsHTML(true);
$mail->AddAddress($to);
$mail->SetFrom(C("esoTalk.emailFrom"), sanitizeForHTTP(C("esoTalk.forumTitle")));
$mail->Subject = sanitizeForHTTP($subject);
$mail->AltBody = strip_tags($body);
$mail->Body = $body;
$mail->Encoding = 'quoted-printable';
return $mail->Send();
} catch (Exception $e) {
return false;
}
}
示例2: sendEmail
function sendEmail($to, $subject, $body)
{
$phpmailer = PATH_PLUGINS . '/vendor/class.phpmailer.php';
require_once $phpmailer;
$mail = new PHPMailer(true);
if ($return = ET::first("sendEmailBefore", array($mail, &$to, &$subject, &$body))) {
return $return;
}
$mail->CharSet = 'UTF-8';
$mail->IsHTML(true);
$mail->AddAddress($to);
$mail->SetFrom(C("esoTalk.emailFrom"), sanitizeForHTTP(C("esoTalk.forumTitle")));
$mail->Subject = sanitizeForHTTP($subject);
$mail->Body = $body;
return $mail->Send();
}