Rehmat Alam A blogger who has fallen in love with coding! Here at SupportiveHands.net, I share things that relate to coding, servers, E-marketing, and other related fields.

PHPMailer: Called Mail() without being connected cPanel/WHM

1 min read

PHPMailer is the most trusted PHP class to send emails that provide a complete set of features to enable you to send emails the easy way from your PHP apps. This class supports SMTP protocol too. WordPress and several other CMS systems use this class. If you have started using PHPMailer in your projects too and facing a bug like I faced recently on a client site, then here is the solution.

One of my clients was using PHPMailer on his cPanel/WHM VPS server but the email wasn’t being sent and PHPMailer was presenting an error ‘PHPMailer: Called Mail() without being connected‘. Remember that login credentials and ports were all correct. I researched for solutions on the web but didn’t find any specific solution that could address my issue.

At last, I started checking the options in WHM and found that ‘SMTP Restrictions‘ was enabled. I Just had to disable it and the issue resolved.

Remember that this is a security feature of WHM and when you will telnet the remote ports (465, 587), you will get connected but to get the PHPMailer working in your cPanel account, you have to disable SMTP Restrictions option. So simply search for SMTP Restrictions in the sidebar search box and then disable this feature. I hope this will resolve your all issues.

This guide is just for WHM/cPanel users. If you are still having issues after disabling this or if you are looking for a solution to this issue on a non-WHM server, then confirm that you are using the correct ports and login credentials. Generally, the port for SSL is 465 and for TLS, it is 587. You should contact your service provider (in my case Amazon SES) to get the correct credentials if other solutions don’t work for you.

Do you have any other fix for this? Or are you still facing issues with PHPMailer? Just post a comment below and I’ll try my best to help you as much as I can.

Rehmat Alam A blogger who has fallen in love with coding! Here at SupportiveHands.net, I share things that relate to coding, servers, E-marketing, and other related fields.

How to bulk delete posts by a user in…

vBulletin is the most powerful forum software out there but sometimes its complex (or I can say that the ugly) administration control panel makes...
Rehmat Alam
1 min read

How to Backup and Restore a Large MySQL Database

phpMyAdmin is the most familiar tool for database management on small and medium-sized websites and blogs. This free tool makes the task of database...
Rehmat Alam
1 min read

How Do I Permenantly Delete My Blog on Blogger

Blogger, the Google’s free blogging platform, allows you to create up to 100 blogs per account for free. If you have created a lot...
Rehmat Alam
1 min read

Leave a Reply

Your email address will not be published. Required fields are marked *