YetiForceCompany / YetiForce

One of the most innovative CRM systems that supports mainly business processes and allows for customization according to your needs. Be ahead of your competition and implement YetiForce!
https://yetiforce.com
4 stars 3 forks source link

SMTP connection is not possible without encryption. #57

Open IgorA100 opened 1 week ago

IgorA100 commented 1 week ago

This is because by default PHPMailer.php has TLS encryption enabled. If the SMTP server does not support encryption, it is not possible to connect to it.

    /**
     * Whether to enable TLS encryption automatically if a server supports it,
     * even if `SMTPSecure` is not set to 'tls'.
     * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
     *
     * @var bool
     */
    public $SMTPAutoTLS = true;

If encryption is not specified in the SMTP settings, then SMTPAutoTLS should be disabled Solution: In the file "\app\Mailer.php" change the code:

BEFORE:

        $this->mailer->SMTPSecure = $this->smtp['secure'];
        $this->mailer->SMTPAuth = (bool) $this->smtp['authentication'];

AFTER:

        $this->mailer->SMTPSecure = $this->smtp['secure'];
        if (!$this->smtp['secure']) {
            $this->mailer->SMTPAutoTLS = false;
        }
        $this->mailer->SMTPAuth = (bool) $this->smtp['authentication'];