I am using the SMTP module (7.x-1.0) on Drupal 7. The site is hosted on a cloud server on which I've installed LAMP. My SMTP config settings are:

When I try to send a test email, I get two messages and an error in the "Reports > Recent log messages":

  1. A test e-mail has been sent to [email protected]. You may want to check the logs for any error messages.
  2. Unable to send e-mail. Contact the site administrator if the problem persists.
  3. Error sending e-mail (from [email protected] to [email protected]).

The email is NOT sent. However, the email appears in "Reports > Maillog" (Maillog module).

There is an error in /var/log/apache2/error.log:

sh: 1: /usr/sbin/sendmail: not found


  • I was under the impression that the SMTP module avoids the need for Sendmail.I thought, the whole point was that it uses an external SMTP server. I found the following issue by the way: drupal.org/node/1078106.

3 Answers 3


It looks like the sendmail service is not installed.

Try the command sudo apt-get install sendmail via ssh to install it.


Sending email through Gmail's FTP from a webserver can sometimes be blocked by Google.

Login to the account in a web browser, then visit this link: https://accounts.google.com/displayunlockcaptcha

After you've done the unlock captcha, try your smtp test again.


enabling 'Allow less secure apps' on https://myaccount.google.com/security#activity page fixed the problem for me.

I found this solution from here.

Not the answer you're looking for? Browse other questions tagged or ask your own question.