2

I've recently moved my website to a new server.

I've changed the DNS record to use the new server for the website but, I'm still using the old one as a mail server. So, basically, the DNS is set up to the new server for the normal web traffic and to the old one for email (MX on the DNS).

Now, I have a contact form on Wordpress that should be able to use one of my email address.

I've set up the email address to work as SMTP on my server but it seems not working.

I've not added records for that on the DNS; I've just the record that directs the mail traffic to the old server. Do I need and, in case, which records should I've to add?

2 Answers 2

1

Providing your old server is properly configured then the problem shouldn't be with the DNS records. Moving your website to the new server should have only required changing the A records for example.com and www.example.com, not whatever subdomain is pointed to your mail server.

Double check that your mail server is configured for something like smtp.example.com or mail.example.com and that the IP address is for the old server. Then make sure in the mail server settings, it knows to accept mail on that address.

If the WordPress site was able to send mail via SMTP prior to the move, you should ensure that your mail server has the new server whitelisted for sending mail and that the site is using the correct authentication methods.

4
  • The fact is that, before moving the website to the new server, everything was working well with Wordpress using the email address of the website to send email from the contact form as well as reset password email and stuff
    – NicoCaldo
    Nov 16, 2019 at 16:12
  • Check that the SMTP server defined in WordPress isn't localhost Nov 16, 2019 at 16:16
  • I'm pretty sure it is set as localhost. Is there a way to change it? (as my old server SMTP needs authentication to work)
    – NicoCaldo
    Nov 16, 2019 at 18:29
  • Depends what you're using for your mail. IIRC WP doesn't support SMTP out-of-the-box and you'll have needed a plugin to make that work. The SMTP server address should be in the settings for that plugin. Nov 16, 2019 at 19:56
0

So the problem was a misconfiguration of Email Routing on cPanel.

The solution has been, selecting my subdomain email on Email Routing in cPanel and instead Automatically Detect Configuration I need to choose Local Mail Exchanger

Now the mails via the SMTP and subdomain are correctly received from the mail server.

The DNS servers were configured in the right way tho.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.