Step 1: Mail Routing Setting
For anyone setting up cPanel and using a PHP mailer function to send messages through the hosting there are a few things that can really get in the way even if your script and configuration is correct.
First we log into the cPanel and go down to the “Mail” section. Then we select the third option “Email Routing”
The next step is to select your domain from the drop down menu.
Most likely your routing is set to local… this is wrong for our needs.
Let me explain what’s going on… the hosting has it’s own email functionality…. cPanel has a mail feature. Now before you get excited let me say DON’T BOTHER USING IT. It’s usable but far from optimal and you’ll inevitably end up with frustrations. The email gets issued from the hosting and has to bounce through a proxy and get batched and released and it’s a whole thing. Not for professionals, not for anyone who wants their messages to arrive in a timely fashion. (For your form… it’s fine, but not for critical timely emails.)
What cPanel is doing is trying to hold onto the messages and deliver them internally. It’s trying to be helpful by routing the messages to your cPanel inbox (which you don’t have because you’re a real business.) So we need to tell cPanel to send those messages to the outside world to be delivered to your actual inbox.
Go ahead and select the “Remote Mail Exchanger” setting and click “Change”. Now cPanel knows to send your form messages to the outside world where they should land right.
Step 2: Make sure your email comes from your domain.
Next we need to go into your form configuration/settings and check where your email is getting sent “from“. This is important because of all the spam and garbage online… most of the hosting providers will not let you send messages FROM your hosting unless it’s FROM your website/domain.
If your domain is simplewebsitehelp.com then your FROM email address should be [whatever]@simplewebsitehelp.com. NOT [email protected]. Because you aren’t gmail, you aren’t sending FROM gmail and if they checked the DNS records you certainly aren’t sending your message FROM the gmail servers.
Using a WordPress plugin to fix the form data
Install and activate WP Mail SMTP
Update the “from” field (donotreply@yourdomain.ext) and enable “force from email”.
Change the configuration type to SMTP and add the settings from the link below \/
https://www.godaddy.com/help/send-form-mail-using-an-smtp-relay-server-953
** if you’re using the managed WordPress hosting product then you can just leave the “mailer” type: PHP/Default/(none).
Go to Step 3 Below if you don’t care about the tech!
Further information on hosting generated message labels
Another circumstance is the mailer attempting to use the system email account. Each shared hosting cpanel gets its own infrastructure email address to communicate internally. If you do not specify a “from” email address then it could default to using that label.
The GoDaddy internal email URL’s have secureserver.net on the root of the email domain. Your shared hosting cpanel is not going to have permission to send messages on behalf of secureserver.net so those will fail DKIM and DMARK checks. Once again… the “from” field MUST be labeled to send from your domain/website/url.
So now that you’ve updated your contact form to reflect an email… any email.. FROM your domain. You should be able to get it past the proxy server.
Ideally the handle is “donoreply” at your domain. This makes sure that humans and robots know this message is intended to be one way.
Your hosting generated messages should come FROM donoreply@[yourdomain.ext]
Another example of this configuration would be (using php mailer script without wordpress):
mail($to,$subject,$message,$headers,“-f donotreply@[yourdomain.ext]”);
I can’t go over all the different scripting or coding options but you get the idea… review the labeling/encoding/how you build the message and find the relevant override for that field.
Step 3: Make sure you’ve included the sending server in your SPF record.
You probably (and should) have your email provider from somewhere other than cPanel. So your current SPF record will call out where your inbox lives and that server. But as of now you probably don’t include your shared hosting with that TXT record in the DNS.
So you should add an “include:” to your SPF record with whatever your hosting provider has for their shared hosting proxy.
For GoDaddy, Media Temple and all Secure Server hosting we can find the full SPF record is:
v=spf1 a mx ptr include:secureserver.net -all
So you need to grab the “include:secureserver.net” part of that and place it in your current SPF record so your primary inbox as well as your hosting are allowed to send messages for your domain.
This will make sure that the messages generated by your hosting will get delivered without getting flagged for spam.
If you’re not sure about your SPF data then contact your inbox service provider and then reach out to your DNS provider.
If you’re having issues with your O365 inbox SENDING MAIL then you’ll need to follow these steps to update the DNS and connect your domain to the inbox.
This is to make sure your Inbox can send with authorization through the domain. (Which is totally different than your hosting being able to send messages from your site to another email address.)