• Resolved milos1

    (@milos1)


    Hello,

    Does anybody know where to place the php program mailpoet_smtp_secure_connection_options_hook.php ?

    Regards, Milo?

    ——————–

    https://kb.mailpoet.com/article/193-tls-encryption-does-not-work

    Issue

    When trying to send a test message/newsletter using a custom SMTP method configured to use TLS encryption, you see the following error message: ” unable to connect with TLS encryption”.

    Description

    PHP 5.6 or newer forces  verification of the destination server’s authenticity. If, for some reason, the server uses an invalid (or self-signed) certificate or your PHP has an invalid/missing certificate authority bundle, the secure connection will fail.

    Solution

    In the case of the invalid/missing certificate authority, please ensure that you host has a properly configured PHP installation that uses a valid certificate authority bundle.

    If you are still unable to connect, it is possible that the destination server is using a self-signed certificate, which is disallowed by default. In this case you can use a custom hook to configure the secure connection?(i.e.,? set SSL context options) and disable self-signed certificates and/or authenticity verification.

    <?php add_filter('mailpoet_mailer_smtp_options', 'mailpoet_secure_connection_options'); function mailpoet_secure_connection_options() { return [ 'ssl' => [ // description of available options can be found here: https://php.net/manual/en/context.ssl.php 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ], ]; }

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘mailpoet_smtp_secure_connection_options_hook.php’ is closed to new replies.