Question

PHP mail() function enable

  • Posted on August 22, 2012
  • info1Asked by info1

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


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Indeed, the steps I took were <br> <br>1) If sendmail isn’t installed, install it: apt-get install sendmail <br>2) Configure hosts file correctly: nano /etc/hosts <br>And make sure the line looks like this: 127.0.0.1 localhost localhost.localdomain yourhostnamehere <br>3) Run the sendmail config and answer ‘Y’ to everything: sendmailconfig <br> <br>I restarted apache for good measure: service apache2 restart <br> <br>After that my mail was sending instantly.

I was having the same problem - sendmail WAY too slow. Found fix for it here: http://www.flogiston.net/blog/2009/05/11/sendmail-painfully-slow-on-ubuntu/

Why don’t you use this way: https://www.digitalocean.com/community/articles/how-to-use-gmail-or-yahoo-with-php-mail-function . This is excellent tutorial and I have never got problem with it. I am using Gmail as SMTP server and everything is both super fast and reliable.