Last updated October 15, 2008. Created on January 28, 2004.
Edited by add1sun, LeeHunter, greggles, chx. Log in to edit this page.

If you are not receiving any E-mails from Drupal, or if E-mail sent by Drupal is bouncing, then ensure that the SMTP configuration is set properly in your php.ini.

If you continue to have problems, the use the "user_mail_wrapper" option included with Drupal.

You can now hook up your own custom SMTP library to Drupal instead of using the default PHP mail() function. For more people mail() will work just fine, but for others this is a major problem and it does not work properly. If you just want to get started you will have to download a custom wrapper function from the Drupal contrib repository. If you already have a favorite SMTP function you want to use you will have to create your own wrapper function.

Make an include file that defines a user_mail_wrapper function: user_mail_wrapper($mail, $subject, $message, $header); This function should take the parameters and pass them to the SMTP lib. You will probably have to configure the SMTP lib in some way.

Modify your configuration file (conf.php) to include: $conf["smtp_library"] = "path/to/wrapper.inc";

Check out http://cvs.drupal.org/viewcvs/drupal/contributions/tricks/smtp/ for an example.

Originally written by Kjartan on January 9, 2002, with modifications.

Customize smtp.inc from the repository above to ensure that the proper settings for your SMTP server are being used.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

juan_g’s picture

Installing a test site on my local computer for development, the php.ini file didn't provide fields for username and password to use the SMTP server of my webhost.

The solution was to install Drupal's SMTP module, which provides those fields, and can send test emails to verify it's working. See the install.txt and readme.txt files included with the module.