Differences From Artifact [787abfba04]:

To Artifact [34b8cc4485]:


466
467
468
469
470
471
472
473
474






















475
476
477
478
479
480
481

        $subject = '=?UTF-8?B?'.base64_encode($subject).'?=';

        if (is_array($to))
        {
            foreach ($to as $t)
            {
                return mail($t, $suject, $content, $headers);
            }






















        }
        else
        {
            return mail($to, $subject, $content, $headers);
        }
    }








|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503

        $subject = '=?UTF-8?B?'.base64_encode($subject).'?=';

        if (is_array($to))
        {
            foreach ($to as $t)
            {
                return self::_sendMail($t, $suject, $content, $headers);
            }
        }
        else
        {
            return self::_sendMail($to, $subject, $content, $headers);
        }
    }

    static protected function _sendMail($to, $subject, $content, $headers)
    {
        if (SMTP_HOST)
        {
            $const = '\KD2\SMTP::' . strtoupper(SMTP_SECURITY);
            
            if (!defined($const))
            {
                throw new \LogicException('Configuration: SMTP_SECURITY n\'a pas une valeur reconnue. Valeurs acceptées: STARTTLS, SSL, NONE.');
            }

            $secure = constant($const);

            $smtp = new SMTP(SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD, $secure);
            return $smtp->send($to, $subject, $content, $headers);
        }
        else
        {
            return mail($to, $subject, $content, $headers);
        }
    }