本文整理汇总了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();
}