File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 211211 'host ' => getenv ('SMTP_HOST ' ) ?: null ,
212212 'port ' => 587 ,
213213 'auth ' => true ,
214- 'secure ' => 'tls ' ,
214+ 'secure ' => 'tls ' , // Enable TLS encryption. Set to `tls`, `ssl` or `false` (to disabled)
215215 'username ' => getenv ('SMTP_USER ' ) ?: null ,
216216 'password ' => getenv ('SMTP_PASSWORD ' ) ?: null ,
217217 'smtp_debug ' => 4 ,
Original file line number Diff line number Diff line change @@ -67,6 +67,13 @@ public function __construct($logger, $config = [])
6767 $ this ->phpMailer ->Password = $ config ['password ' ];
6868 $ this ->phpMailer ->SMTPDebug = $ config ['smtp_debug ' ];
6969
70+ // Disable opportunistic encryption if secure is unset. This is
71+ // required if you have an incorrect or invalid SSL Certificate on
72+ // your SMTP host, but the server offers STARTTLS.
73+ if (!$ config ['secure ' ]) {
74+ $ this ->phpMailer ->SMTPAutoTLS = false ;
75+ }
76+
7077 if (isset ($ config ['smtp_options ' ])) {
7178 $ this ->phpMailer ->SMTPOptions = $ config ['smtp_options ' ];
7279 }
You can’t perform that action at this time.
0 commit comments