Symptoms
When trying to send mail via PHPMailer, the following error is returned:
Peer certificate CN=`hostname' did not match expected CN=`remote.domain'
PHP Mail() also will not function as expected.
Description
By default, cPanel servers restrict the ability of scripts on the server from sending mail. This is to prevent potential abuse but can make some scripts malfunction if they aren't sending mail via the system when using PHP handlers other than CGI.
This can also happen for invalid or mismatched certificates.
Workaround
Restrict SMTP Tweak
- Log into WHM as the 'root' user.
- Navigate to "Home » Server Configuration » Tweak Settings."
- Search "FKA" or click on the "Mail" tab and scroll down to the "Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak)" setting.
- Set the "Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak)" setting to "Off."
- Click the "Save" button to save the changes.
SSL to IP
If you try to connect to an IP address rather than a domain, SSL will fail to verify. Please use a fully qualified domain name for your SMTP server.
Comments
0 comments
Article is closed for comments.