When attempting to send an email with remote SMTP authentication in PHP, the connections are only made to localhost. The PHP script will also report authentication failure.
PHP scripts can be configured to use a remote SMTP server. However, the default cPanel configuration restricts all SMTP connections to localhost. Disabling the SMTP restriction will permit PHP scripts to make remote SMTP connections.
- Log into WHM as the ‘root’ user.
- Navigate to the interface "Home / Security Center / SMTP Restrictions."
- Click the "Disable" button.