Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP connection is not possible without encryption. #57

Open
IgorA100 opened this issue Nov 12, 2024 · 0 comments
Open

SMTP connection is not possible without encryption. #57

IgorA100 opened this issue Nov 12, 2024 · 0 comments

Comments

@IgorA100
Copy link

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'];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant