cPanel installed, Wordpress does not send emails

Posted June 23, 2019 3.9k views

I installed cPanel from the marketplace onto my droplet. I have transferred my wordpress site over to the hosting account. but now my wordpress site seems to be having issue sending out emails.

1 comment
  • I tried uploading a simple phpsendmail script but it doesn’t run either.

        ini_set( 'display_errors', 1 );
        error_reporting( E_ALL );
        $from = "***@****.com";
        $to = "***@****.com";
        $subject = "PHP Mail Test script";
        $message = "This is a test to check the PHP Mail functionality";
        $headers = "From:" . $from;
        mail($to,$subject,$message, $headers);
        echo "Test email sent";

    I censored out the to and from addresses.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Is cpanel free of cost? I have heard it will cost around $15/month extra.

Hello @derrickgoh,

I recommend using cPanel >> Email Accounts to create a dedicated email address for your WordPress installation. Then, install a WordPress plugin to facilitate the use of SMTP for sending email from WordPress. Here’s a popular WordPress plugin that adds SMTP support:

Otherwise, if you prefer to send email from Wordpress via the PHP Mail function, check /var/log/exim_mainlog for specific errors upon testing the PHP mailing script and let me know what you see. Here’s a command you can execute to see the recent entries in this log file during testing:

tail -f /var/log/exim_mainlog

Let me know if you have any questions or require additional assistance.

Thank you.