vernes / YiiMailer

Yii extension for sending emails with layouts using PHPMailer
81 stars 38 forks source link

TLS 1.2 support? #41

Closed ckt114 closed 1 year ago

ckt114 commented 1 year ago

Hi,

Our email server upgraded TLS to 1.2 and this component is no longer able to email and throwing error below. My app was written in Yii 1.1 so it's using YiiMailer 1.6. I've read through the source code but not seeing any ways to specify the TLS version. Do you know if there's a way? TIA.

Error

stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1409442E:SSL routines:SSL3_READ_BYTES:tlsv1 alert protocol version
vernes commented 1 year ago

Hi. Please take a look at PHPMailer and its configuration. It also depends on the PHP version you are running.

https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#using-encryption

https://github.com/PHPMailer/PHPMailer/issues/542

Quick search points to this part of configuration, but I did not test it: $mail->SMTPOptions = array( 'ssl' => array( 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT ) );

ckt114 commented 1 year ago

Thank you.