Pages

Thursday 19 January 2017

Wordpress Contact Form 7 emails won't send to Office 365 [Solved]

I got a job to set up a new business website for a client. The job involved setting up a brand new Wordpress website on a new host and not on the old host they were currently with. Their domain names and email were also registered at the old host too but would not be moved.

So, the new Wordpress website went up without a hitch but I ran into a problem where a form on the contact page that was using the Contact Form 7 plugin wouldn't send emails to any 'whoever@companydomainname.com' email address, it would however send emails to any other address (eg. whoever@yahoo.co.uk, whoever@hotmail.com etc) as long as it didn't use the @companydomainname.com.

To resolve this I contacted my hosting support and they instructed me to go into cPanel, go to Email and select MX Entry.



Then select the 'companydomainname.com' and make sure Email Routing was set to 'Remote Mail Exchanger'.


Unfortunately this alone did not fully solve my problem.

It wasn't until further investigation on the DNS Zone settings for the domain name at the old host that I discovered they were using Office 365 for their email and not the built in host email service I had assumed.

I discovered this because of  three DNS Zone records that looked like this:

v=spf1 include:spf.protection.outlook.com -all

autodiscover.outlook.com

clientconfig.microsoftonline-p.net


I then went into the cPanel on the old host and checked the Email MX Entry for the domain, which looked like this:

companydomainname-com.mail.protection.outlook.com

So I copied this and went back to the Email MX Entry on the new host. I selected the 'companydomainname' and then removed the 'companydomainname.com' under the MX Records section.



I then inserted companydomainname-com.mail.protection.outlook.com into the destination box under the 'Add New Record' heading and clicked 'Add New Record'


The companydomainname-com.mail.protection.outlook.com then appears in the MX Records section



After this the form on my website would correctly send emails to any whoever@companydomainname.com email address.

Hope this helps someone out.

This link was also useful






30 comments:

  1. How long did it take your DNS to repopulate?

    ReplyDelete
  2. Hi, Did you have to do both changes? Set 'Remote Mail Exchanger' and add the MX record companydomainname-com.mail.protection.outlook.com

    I have the same issue on a company website so don't want to break their incoming mail

    ReplyDelete
    Replies
    1. Yep, exactly as I have it written above, it shouldn't break their incoming mail as you are not configuring any settings on their actual incoming mail server.

      Delete
  3. I have the exact same situation as described here. however my contact 7 form won't send emails even if they are going to a different address. I'm using hostgator and the client is using office 365. I made the changes you suggested but nothing...even an hour later. I'm at a loss at this point.

    ReplyDelete
  4. Never could get this to work. I had to install an SMTP plugin.

    ReplyDelete
  5. Thank you! You helped me so much... I have been searching for a fix for 3 days now!!! This worked... My website host had installed a plugin "WP Mail SMTP" which I had to disable... No one could fix our issue... until I came across your post xxx

    ReplyDelete
    Replies
    1. Yep took me a while too, glad it helped you out

      Delete
  6. 10+ hours of troubleshooting Contact Form 7 (myself),
    2 Upwork freelancers who were supposed to make the form work,
    3 hours on the phone with Godaddy....
    and it turns out that all I needed was this
    1 article.
    Thank you for sharing. You are a godsend. Seriously. THANK YOU for this!!!

    ReplyDelete
    Replies
    1. No problem, glad it saved you some hair loss

      Delete
  7. Thank you so much! Glad I stumbled across this article in the early stages of also discovering this problem. Sounds like you saved me a lot of time.

    ReplyDelete
  8. Thanks so much for sharing this! I had the exact same issue, and this fixed it in minutes.

    ReplyDelete
  9. Hello, I have made the settings like you did but It didn't work still.

    Here is a screenshot of my SMTP settings

    https://prnt.sc/t5nqpq

    and here are the settings of cPanel https://prnt.sc/t5nrvx

    I want to get the Form Responses to my Office 365 mail not to GoDaddy's mail, can you help please?

    ReplyDelete
    Replies
    1. Have you tested to see if you can make the form responses go to a yahoo/gmail/hotmail address?

      Delete
  10. This worked for me on bluehost.com as well although the steps were slightly different. I was able to use this post to figure it out. Thanks!

    ReplyDelete
  11. Worked perfectly! Thanks!!

    ReplyDelete
  12. Not all heros wear capes

    ReplyDelete