Sending email takes a long time on NGINX? Here’s how to fix

I’ve recently switched our servers from Apache to NGINX. While testing our WP Form Builder Add-on, I found that my web server took pretty long time for the mail function to process, however, on the local server, everything works pretty smooth.

While digging Google, I found the solution which fixed this issue. If you are facing the same problem, follow the steps below to resolve it.

Log in to your server via SSH as root user and run the following command:

nano /etc/hosts

You will find an entry that looks like this

127.0.0.1 localhost

All you need to do is add localhost. local domain after this so it should look like this:

127.0.0.1 localhost localhost.localdomain

Press CTRL+X and then Y to save the file. Now, your server mail should process in nanoseconds.

Sometimes, a small fix with a few characters here and there can waste hours. I thought I’d share this here so that it will save some of your time.

Contact Us

Our Services

Enquiry Now

When We Work Together

We can create something incredible

arrow
HQ INDIA
HQ INDIA
C-31, Milap Nagar,
Uttam Nagar, New Delhi,
Delhi 110059
USA
USA
6715 Backlick Rd Suite 202
Springfield,
VA 22150, USA
AUSTRALIA
AUSTRALIA
2/51, Lane Cres,
Reservoir, VIC
3037, Australia
CANADA
CANADA
61 Payzant Bog Road, Falmouth, NS, B0P 1P0, CANADA
UK
UK
3rd Floor, 131 City Road, London, EC1V 2NX, United Kingdom
UAE
UAE
Boutik Mall, Al Reem Island - Abu Dhabi, UAE
X

Let Us Call You Back

  • India+91
  • United States+1
  • United Arab Emirates+971

Your phone number is kept confidential
and not shared with others.