PHP form mail settings on GoDaddy

Although we put 99% of our client websites on MediaTemple Grid Hosting, we have the occasional client who requests their website be hosted on GoDaddy's cPanel servers. Besides the shared environment, one of the biggest downsides of GoDaddy's cPanel hosting is unreliable email and undocumented details around using cPanel email to send your website's PHP form mail.

We spent a ton of time testing multiple configurations, but only one finally worked for us. Note that in this client's situation, they're using Office365 as their primary email service, so using that to send PHP form mail from GoDaddy wasn't a good option for us. We set up a unique email address in cPanel which we'll use to send PHP the website's form mail from.

It's important to note that in order for form mail to work at all in this scenario, you need to double check your MX Entry settings for the cPanel domain you'll be using to send your PHP form mail.


Warning: Setting the wrong option here can break receiving mail on your server. If you are at all unsure about which option to select, contact your system administrator or call GoDaddy for support.


  • From your cPanel hosting account, scroll down to the Email section and click on the MX Records link
  • From the MX Entry page, select the domain your form is hosted on
  • Under Email Routing, make sure Remove Mail Exchanger is selected, and click Change to save your changes

Assuming you've already set up your cPanel email address you're going to send mail from (e.g. hello@mycompany.com), here are the PHP form mail connection server settings you'll need to get this working:

$server = 'localhost'
$port = 465
$scheme = 'ssl'

Don't forget your username (the unique email address you created in your cPanel) and password. And of course, always test your website's contact forms regularly to make sure they're working.

Gotchas: Make sure your 'from' email address used to send your PHP form email is the same one you're using for your login credentials. Otherwise, the email form will submit successfully but submitted emails will disappear forever into the abyss that is GoDaddy's webmail.

If you need help setting up your current website on GoDaddy, or just want to chat with us about how to improve your current website, we’d love to help.

Contact Us


Kevin Becker

Kevin Becker

Cofounder // Humble Meteor

Follow us on Twitter

Work with us