2

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:

  • SMTP server: smtp.gmail.com
  • SMTP port: 465
  • Use encrypted protocol: SSL
  • Username: example@gmail.com
  • Password: [password]
  • E-mail from address: example@gmail.com

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 example@gmail.com. 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 example@gmail.com to example@gmail.com).

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

Update/Edit:

  • 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.
1
1

It looks like the sendmail service is not installed.

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

0

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.

0

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.