16

I get the following error message in admin/user/user:

Unable to send e-mail. Please contact the site administrator if the problem persists.

Is this error caused by the fact I haven't an email service installed on my server? thanks

Update: I now get the following error.

Error sending e-mail (from "Website Name" to email@gmail.com). Attempt to e-mail email@gmail.com concerning order 114 failed.

kiamlaluno
  • 24,790
  • 16
  • 70
  • 85
aneuryzm
  • 55,858
  • 96
  • 259
  • 471
  • Related: [Unable to send e-mail. Contact the site administrator if the problem persists](http://drupal.stackexchange.com/q/17291/1908) – kenorb May 31 '16 at 10:47

3 Answers3

25

This error is due the fact that your mail service is not configured. Drupal, by default, trying to send the user some email and after it fail, it show this message.

If you Drupal is running on Ubuntu it is quite easy to install the mail service:

sudo apt-get install php-pear
sudo pear install mail
sudo pear install Net_SMTP
sudo pear install Auth_SASL
sudo pear install mail_mime
sudo apt-get install postfix

And that's it!

Ran Bar-Zik
  • 1,217
  • 9
  • 14
4

Even after installing postfix, you still might not be able to send mail with Drupal. Even if you can send mail from command line and a console php script, your attempt to send from Drupal (or any other apache web app) might fail. I'm using postfix on CentOS 6.x. I found that my CentOS VM by default was set to prevent httpd from sending mail. The problem was that my system had httpd_can_sendmail = Off in sebool values.

The solution was described at http://www.spidersoft.com.au/2011/posftix-permission-denied-problem/

$ /usr/sbin/getsebool httpd_can_sendmail

Confirm that httpd_can_sendmail --> off

Problem was solved by:

$ setsebool httpd_can_sendmail 1

Or permamently set it with:

$ setsebool -P httpd_can_sendmail 1
kenorb
  • 118,428
  • 63
  • 588
  • 624
NormK
  • 121
  • 1
  • 3
0

Yes, if you don't have sendmail or any other means by which PHP can send emails, you will see this error.

Simon
  • 36,947
  • 2
  • 32
  • 27