Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Unable to send e-mail. Please contact the site administrator" [closed]

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 protected]). Attempt to e-mail [email protected] concerning order 114 failed.

like image 470
aneuryzm Avatar asked Nov 19 '10 10:11

aneuryzm


2 Answers

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!

like image 87
Ran Bar-Zik Avatar answered Sep 27 '22 21:09

Ran Bar-Zik


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
like image 39
NormK Avatar answered Sep 27 '22 19:09

NormK