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]);
     }
 }
 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
0
 /**
  * @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();
 }