Problem sending emails via smtp

Marks

Verified User
Joined
Jul 13, 2019
Messages
121
PHPMailer has the following error when trying to send email via the hosting account:
SMTP connect() failed

But when sending by the same script through my localhost WAMP server, it sends normally.

Through exim maillog I have the following errors:
2021-10-05 19:19:03 TLS error on connection from XXXX.XXX.X (WEBSITE.COM) [IP.IP.IP.IP.] (SSL_accept): NULL (TLSv1)

and also

SSL_accept (TLSv1)): error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol

host: mail.domain.com
port: 587
authentication: tls
email account username and password
 
its csf related, set an exception for the corresponding user and it works
 
TLSv1 is obsolete(as sslv3), you need to use TLSv1.2 or TLSv1.3, you need to update your email client.
 
TLSv1 is obsolete(as sslv3), you need to use TLSv1.2 or TLSv1.3, you need to update your email client.
But I don't understand, why the local upload works and the server is not working, it displays the error.
ssl configuration is OLD in custombuild
 
You can try this:

in: (you can create the file if isnt exist)
Code:
/etc/exim.variables.conf.custom
add:
Code:
openssl_options=+no_sslv2 +no_sslv3
tls_require_ciphers=ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS

After that, rebuild the exim config

Code:
/usr/local/directadmin/custombuild/build exim_conf
 
You can try this:

in: (you can create the file if isnt exist)
Code:
/etc/exim.variables.conf.custom
add:
Code:
openssl_options=+no_sslv2 +no_sslv3
tls_require_ciphers=ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS

After that, rebuild the exim config

Code:
/usr/local/directadmin/custombuild/build exim_conf

did not work.
see the phpmailer return on the server

2021-10-06 12:10:39 SERVER -> CLIENT: 220 hostname ESMTP Exim 4.95 Wed, 06 Oct 2021 09:10:39 -0300
2021-10-06 12:10:39 CLIENT -> SERVER: EHLO domainclient.com
2021-10-06 12:10:39 SERVER -> CLIENT: 250-hostname Hello rDNS [IP.IP.IP.IP] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-PIPE_CONNECT 250-AUTH PLAIN LOGIN 250-STARTTLS 250 HELP
2021-10-06 12:10:39 CLIENT -> SERVER: STARTTLS
2021-10-06 12:10:39 SERVER -> CLIENT: 220 TLS go ahead
2021-10-06 12:10:39 SMTP Error: Could not connect to SMTP host.
2021-10-06 12:10:39 CLIENT -> SERVER: QUIT
2021-10-06 12:10:39 SERVER -> CLIENT: 221 hostname closing connection
2021-10-06 12:10:39 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
 
Try in phpmailer

Code:
$mail->SMTPDebug = true;

To get more information to compare with /var/log/exim/mainlog
 
Back
Top