Report this

What is the reason for this report?

PHP mail() function enable

Posted on August 22, 2012

Hi DigitalOcean team, first of all, congrats for everything ! That an awesome service ! Next, I would know how to enable the mail() fonction. By default I think it’s disabled because I received an error with wordpress trying to retreive a lost password.

Le message n’a pas pu être envoyé. Raison possible : votre hébergeur peut avoir désactivé la fonction mail()…

The message can’t been sent. Possible reason : your host has maybe deactivated mail() function…

Thank you



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

I spent hours tonight trying to figure out why sendmail and the php mail() function wouldn’t work on my DigitalOcean server. I followed all of the tutorials and couldn’t get anything to work. It turns out Gmail was blocking all of the mail coming from my DigitalOcean server. The mail I was sending couldn’t even make it to the spam folder. I discovered this by running sendmail from the command line. I then tried sending mail to a non-gmail account, and it worked just fine! So if anyone else is going through hell trying to figure this out, try sending some mail to a non-gmail account, or try running sendmail from the command line to see if you get some sort of error about Google / Gmail blocking your mail to prevent spam.

AND ONE MORE THING: The DigitalOcean server that was blocked by Gmail was not associated with a domain name, it simply had an IP address. I tried using sendmail and the php mail function on another DigitalOcean server of mine that is associated with a domain name, and that email was NOT BLOCKED. So if Gmail is blocking mail from your DigitalOcean server, it may be because your server isn’t associated with a domain name.

An error occurred.

Sorry, the page you are looking for is currently unavailable. Please try again later.

If you are the system administrator of this resource then you should check the error log for details.

Faithfully yours, nginx.

@sunjerseys.com <br> <br>After changing my hosts file my email sends from this address: <br> <br>info@localhost.localdomain <br> <br>Any ideas?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.