本文整理汇总了PHP中NotificationMail::ClearAddresses方法的典型用法代码示例。如果您正苦于以下问题:PHP NotificationMail::ClearAddresses方法的具体用法?PHP NotificationMail::ClearAddresses怎么用?PHP NotificationMail::ClearAddresses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NotificationMail
的用法示例。
在下文中一共展示了NotificationMail::ClearAddresses方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
static function send($mailing_options)
{
$mail = new NotificationMail();
$mail->sendNotification($mailing_options);
$mail->ClearAddresses();
}
示例2: time
$mmail->FromName = $row['email'];
}
}
$body = str_replace("\\r", "", str_replace("\\n", "\n", $_POST['body']));
if ($_POST['users_id_ticketmail']) {
$address = PluginTicketmailProfile::getEmail($_POST['users_id_ticketmail']);
} else {
$address = $_POST["address"];
}
if (!NotificationMail::isUserAddressValid($address)) {
Session::addMessageAfterRedirect(__("Invalid email address"), false, ERROR);
}
$mmail->AddAddress($address, $address);
$mmail->Subject = $_POST["subject"];
$mmail->Body = $body;
$mmail->MessageID = "GLPI-ticketmail" . time() . "." . rand() . "@" . php_uname('n');
if (!$mmail->Send()) {
Session::addMessageAfterRedirect(__("Your email could not be processed.\nIf the problem persists, contact the administrator"), false, ERROR);
} else {
Toolbox::logInFile("mail", sprintf(__('%1$s: %2$s'), sprintf(__('An email was sent to %s'), $address), $_POST["subject"] . "\n"));
$changes[0] = 0;
$changes[1] = $address;
$changes[2] = $_POST['subject'];
Log::history($_POST['id'], 'Ticket', $changes, 'PluginTicketmailProfile', Log::HISTORY_PLUGIN + 1024);
Session::addMessageAfterRedirect(sprintf(__('An email was sent to %s'), $address));
}
$mmail->ClearAddresses();
Html::redirect($_SERVER['HTTP_REFERER']);
} else {
Html::redirect("../index.php");
}