Example #1
0
 /**
  * Constructor
  *
  **/
 function __construct()
 {
     global $CFG_GLPI;
     $this->WordWrap = 80;
     $this->CharSet = "utf-8";
     // Comes from config
     $this->SetLanguage("en", Config::getLibraryDir("PHPMailer") . "/language/");
     if ($CFG_GLPI['smtp_mode'] != MAIL_MAIL) {
         $this->Mailer = "smtp";
         $this->Host = $CFG_GLPI['smtp_host'] . ':' . $CFG_GLPI['smtp_port'];
         if ($CFG_GLPI['smtp_username'] != '') {
             $this->SMTPAuth = true;
             $this->Username = $CFG_GLPI['smtp_username'];
             $this->Password = Toolbox::decrypt($CFG_GLPI['smtp_passwd'], GLPIKEY);
         }
         if ($CFG_GLPI['smtp_mode'] == MAIL_SMTPSSL) {
             $this->SMTPSecure = "ssl";
         }
         if ($CFG_GLPI['smtp_mode'] == MAIL_SMTPTLS) {
             $this->SMTPSecure = "tls";
         }
         if (!$CFG_GLPI['smtp_check_certificate']) {
             $this->SMTPOptions = array('ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true));
         }
     }
     if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {
         $this->do_debug = 3;
     }
 }