Symptoms
When trying to send mail via PHPMailer, the following error is returned:
CONFIG_TEXT: Peer certificate CN=`hostname' did not match expected CN=`remote.domain'
PHP Mail() also will not function as expected.
Cause
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.
Resolution
- Log into WHM as the
rootuser - Navigate to Home / Server Configuration / Tweak Settings
- Click on the Mail tab and scroll down to the Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak) setting and set it to Off
- Click the Save button
Note: 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.