No emails are being received from Wordpress hosted on cPanel

bebory

Registered
Apr 18, 2013
2
0
1
cPanel Access Level
Root Administrator
I am a total CPanel newbie - I have root access and have a website in which I have a form creator set up.
When filling out the form none of the emails are received to the recipient or the administrator. When looking at the cpanel admin files, it indicates that the email was sent.

I have this same plugin on another server not running cpanel and it works fine.
Please help
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello,

Could you search for one of the messages in /var/log/exim_mainlog and let us know the output? Here's an example of a command you can use:

Code:
exigrep [email protected] /var/log/exim_mainlog
Ensure you post the relevant output in CODE tags, and remove any identifying information about the domain name or server.

Thank you.
 

NOC_Serverpoint

Well-Known Member
Jul 3, 2016
103
7
18
cPanel Access Level
Website Owner
Hello,

Open the file wp-includes/class-phpmailer.php

In the file you should find:

// PROPERTIES FOR SMTP

In my file its on line 166.

Below that you can edit the SMTP information for wordpress, if you are using googleapps you can use the following information for that:

host: ssl://smtp.gmail.com
port: 465
smtpsecure: tls
smtpauth: true
username: your google apps username
password: your google apps password

Just leave the other smtp settings as they are.

Save that file and upload, now any emails being sent via a contact form from your blog should send just fine.