I was working on a project recently and was trying to send an email via my PHP script using the mail() command when it would appear that my site would just sit and wait for the email to be sent, taking sometimes a minute or two for the page to load. The email would successfully send, however it took forever for my pages to load while trying to send.

To fix this issue, we can do two quick things and you’ll be off and sending email.

First, get your hostname:

$ hostname

Your hostname will be printed out and then we need to edit your /ect/hosts file, which is used for DNS resolution by your system. Open up the file with your favorite editor:

$ sudo vim /etc/hosts

You may see a line that looks like the following:     localhost

We want it to read:    localhost localhost.localdomain your-host-name

Obviously replace your-host-name with what the hostname command outputs.

Post Image via Flickr and CC by Pacdog

Posted by Chris Klosowski

Chris Klosowski is the Director of Technology at Sandhills Development, LLC, creators of fine WordPress plugins, and ecommerce solutions.


  1. If you wish for to take a great deal from this article then you have to apply
    such strategies to your won weblog.


  2. average cost of cialis for daily use – cialis no rx can you buy cialis otc


  3. viagra for sal order viagra onlin gjbdiza – viagra windsor canada


  4. amoxicillin 500 mg generic amoxil – amoxicillin 500mg without prescription


  5. stromectol uk stromectol tablets – ivermectin tablets


  6. prices of viagra at walmart prescription drugs online without doctor – levitra without a doctor prescription


  7. lipitor generic on line no prescription lipitor generic – lipitor 20 mg daily


  8. ivermectin cost stromectol – ivermectin 5 mg price


  9. Hi, i think that i saw you visited my site so i came to “return the favor”.I am
    attempting to find things to improve my site!I suppose its ok to use
    a few of your ideas!!


  10. cialis soft tabs canada cialis discounts – cialis online pharmacy australian


Leave a reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.