Unable to send email from primary domain

Posted June 21, 2017 1.9k views
PHPWordPressUbuntu 16.04

Currently, I have a Ubuntu 16.04 LEMP stack DO droplet hosting a WordPress site, I’ll call the primary domain Email is sent via a contact form on the site. The primary domain’s email is being handled by a different server (not managed by me).

I’m having an issue sending emails via the PHP’s mail() function which WordPress utilizes. I’m able to send email to any domain (,, etc.), however I’m unable to on the primary domain (

I think it has to do with the primary domain trying to stay internal since it’s the same domain name at both locations, and it believes is local to itself and won’t send it out.

I haven’t been able to find a solution for this issue. I feel like it’s a common issue, but my Google search skills have been lacking.

Any help would be much appreciated!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @pixelment

Unless you’re running a MTA like Postfix or Exim, then it shouldn’t be a problem.

Another solution I would recommend that you have a look at SparkPost as an alternative way of sending mails via WordPress.