PHPMailer::isQmail PHP Method

isQmail() public method

Send messages using qmail.
public isQmail ( ) : void
return void
    public function isQmail()
    {
        $ini_sendmail_path = ini_get('sendmail_path');
        if (!stristr($ini_sendmail_path, 'qmail')) {
            $this->Sendmail = '/var/qmail/bin/qmail-inject';
        } else {
            $this->Sendmail = $ini_sendmail_path;
        }
        $this->Mailer = 'qmail';
    }

Usage Example

Example #1
0
 public function execute($_options = null)
 {
     $eqLogic = $this->getEqLogic();
     if ($_options === null) {
         throw new Exception('[Mail] Les options de la fonction ne peuvent etre null');
     }
     if ($_options['message'] == '' && $_options['title'] == '') {
         throw new Exception('[Mail] Le message et le sujet ne peuvent ĂȘtre vide');
         return false;
     }
     if ($_options['title'] == '') {
         $_options['title'] = '[Jeedom] - Notification';
     }
     $mail = new PHPMailer(true);
     //PHPMailer instance with exceptions enabled
     $mail->CharSet = 'utf-8';
     $mail->SMTPDebug = 0;
     switch ($eqLogic->getConfiguration('sendMode', 'mail')) {
         case 'smtp':
             $mail->isSMTP();
             $mail->Host = $eqLogic->getConfiguration('smtp::server');
             $mail->Port = (int) $eqLogic->getConfiguration('smtp::port');
             $mail->SMTPSecure = $eqLogic->getConfiguration('smtp::security');
             if ($eqLogic->getConfiguration('smtp::username') != '') {
                 $mail->SMTPAuth = true;
                 $mail->Username = $eqLogic->getConfiguration('smtp::username');
                 // SMTP account username
                 $mail->Password = $eqLogic->getConfiguration('smtp::password');
                 // SMTP account password
             }
             break;
         case 'mail':
             $mail->isMail();
             break;
         case 'sendmail':
             $mail->isSendmail();
         case 'qmail':
             $mail->isQmail();
             break;
         default:
             throw new Exception('Mode d\'envoi non reconnu');
     }
     if ($eqLogic->getConfiguration('fromName') != '') {
         $mail->addReplyTo($eqLogic->getConfiguration('fromMail'), $eqLogic->getConfiguration('fromName'));
         $mail->FromName = $eqLogic->getConfiguration('fromName');
     } else {
         $mail->addReplyTo($eqLogic->getConfiguration('fromMail'));
         $mail->FromName = $eqLogic->getConfiguration('fromMail');
     }
     $mail->From = $eqLogic->getConfiguration('fromMail');
     $mail->addAddress($this->getConfiguration('recipient'));
     $mail->Subject = $_options['title'];
     $mail->msgHTML(htmlentities($_options['message']), dirname(__FILE__), true);
     return $mail->send();
 }
All Usage Examples Of PHPMailer::isQmail