本文整理匯總了PHP中NotificationMail::SetFrom方法的典型用法代碼示例。如果您正苦於以下問題:PHP NotificationMail::SetFrom方法的具體用法?PHP NotificationMail::SetFrom怎麽用?PHP NotificationMail::SetFrom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NotificationMail
的用法示例。
在下文中一共展示了NotificationMail::SetFrom方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testNotification
static function testNotification()
{
global $CFG_GLPI, $LANG;
$mmail = new NotificationMail();
$mmail->AddCustomHeader("Auto-Submitted: auto-generated");
$mmail->SetFrom($CFG_GLPI["admin_email"], $CFG_GLPI["admin_email_name"]);
$mmail->AddAddress($CFG_GLPI["admin_email"], $CFG_GLPI["admin_email_name"]);
$mmail->Subject = "[GLPI] " . $LANG['mailing'][32];
$mmail->Body = $LANG['mailing'][31] . "\n-- \n" . $CFG_GLPI["mailing_signature"];
if (!$mmail->Send()) {
addMessageAfterRedirect($LANG['setup'][206], false, ERROR);
} else {
addMessageAfterRedirect($LANG['setup'][205]);
}
}
示例2: sendMailRefusedResponse
function sendMailRefusedResponse($to = '', $subject = '')
{
global $CFG_GLPI, $LANG;
$mmail = new NotificationMail();
$mmail->AddCustomHeader("Auto-Submitted: auto-replied");
$mmail->SetFrom($CFG_GLPI["admin_email"], $CFG_GLPI["admin_email_name"]);
$mmail->AddAddress($to);
$mmail->Subject = $LANG['mailgate'][16] . ' ' . $subject;
$mmail->Body = $LANG['mailgate'][9] . "\n-- \n" . $CFG_GLPI["mailing_signature"];
$mmail->Send();
}
示例3: sendMailRefusedResponse
/**
* @param $to (default '')
* @param $subject (default '')
**/
function sendMailRefusedResponse($to = '', $subject = '')
{
global $CFG_GLPI;
$mmail = new NotificationMail();
$mmail->AddCustomHeader("Auto-Submitted: auto-replied");
$mmail->SetFrom($CFG_GLPI["admin_email"], $CFG_GLPI["admin_email_name"]);
$mmail->AddAddress($to);
// Normalized header, no translation
$mmail->Subject = 'Re: ' . $subject;
$mmail->Body = __("Your email could not be processed.\nIf the problem persists, contact the administrator") . "\n-- \n" . $CFG_GLPI["mailing_signature"];
$mmail->Send();
}