Drupal - Unable to send e-mail. Contact the site administrator if the problem persists

Try using:

SMTP Authentication Support

with PHPMailer

If You use Gmail to set up STMP follow this steps:

  1. SMTP server: smtp.gmail.com
  2. SMTP port: 465
  3. Use encrypted protocol:Use SSL
  4. SMTP Authentication -- Your User Name and password
  5. Leave the other options by Default

The error:

Unable to send e-mail.

is coming from drupal_mail() and it's considered to be very general and it may relate to many different things such as misconfiguration of your Drupal site, PHP configuration or SMTP service of your operating system.

The first thing to do, is to check mail system or Apache logs (e.g. /var/log/apache2/error.log) for more details about the error, as you could simply be missing sendmail it-self (unless you'd like to use any external SMTP service).

If your Drupal is hosted on your dedicated server and it's a brand new configuration, most likely you're missing SMTP server (since it's pointing to localhost by default), unless you're planning to use the external one.

If it's your local development machine, either ignore the error (since it should work fine on the dedicated server), try installing MailCatcher, or you'll have to install SMTP server as stated above.

Here are few other suggestions:

  • if using SMTP module, check if you've configured (see README file) it correctly, including the right server settings,
  • check value of mail_system variable, if it's overridden - reset it into default value (drush vdel mail_system),
  • check your PHP mail configuration (php -i | grep -ie mail -e smtp) and confirm that sendmail_path, SMTP host and smtp_port are correct,
  • check connectivity to your SMTP server by using telnet, e.g.

    telnet $(php -r 'echo ini_get("SMTP") . " " . ini_get("smtp_port");')
    

    to double check whether host is not down, resolved by the DNS, or not blocked by the firewall,

  • if using postfix, check if httpd_can_sendmail is set to 1 (setsebool httpd_can_sendmail 1).

Finally test your e-mail by the following PHP command:

php -r 'mail("[email protected]", "Mail test", "It works!");'

and check this page if the e-mail has been received.

Tags:

Webforms

7

Emails