Configuring an SMTP server for sending mail with Drupal
Sending mails from Drupal is a feature we take for granted. Sometimes however you can't rely on the default SMTP settings available from your hosting provider. This week I was unable to send mails from my Drupal site, because the default sendmail installation was no longer functioning. Fortunately I quickly found a solution with the SMTP Authentication Support module.Typically the default SMTP settings are buried in a file named "php.ini". PHP usually comes with a wrapper to the sendmail application. Sometimes the SMTP settings for PHP are crippled or deactivated on purpose, e.g. on shared hosting plans. If you're not in control of your server, then you can't edit this file.
No sending mails for you from Drupal then? Not necessarily.
The SMTP Authentication Support module builds on top of the SMTP library from PHP Mailer. When installed, it will substitute itself to the default mail send API. The basic features of this module are:
- Configuration of a primary and optionally a secondary SMTP server
- Support for SMTP authentication (optional)
- Support for SSL encryption (optional)
- Configuration of sender's email address and name (defaulting to the site name)
- Debug messages and test email (with configurable recipient's address) for checking whether the SMTP configuration is functional
Installation is a 5 step procedure:
- Download and unpack the the SMTP Authentication Support module: it will unpack in an "smtp" directory.
- Download and unpack the PHP Mailer module that corresponds to your needs (I downloaded the PHP 5/6 version).
- Rename the PHP Mailer directory (mine was "PHPMailer_v5.1") to "phpmailer" and drop it into the "smtp" directory (see step 1).
- Upload the "smtp" directory to your host's "sites/all/modules" directory.
- Enable the SMTP Authentication Support module (browse as Drupal admin to admin/build/modules)
Now all that remains, is to configure the SMTP Authentication Support module:
- Browse as Drupal admin to admin/settings/smtp
- Turn the module on

- Specify the SMTP server you want to use. Optionally, specify a backup SMTP server. Check with your hosting provider (or ISP) for the settings that apply to you.
- Configure the SMTP connection settings: specify an alternate SMTP port, authentication (optional), whether an SSL connection should be initiated.
- Configure the sender's identity: email address and sender's name (the latter defaults to the name of your Drupal site).
- Fill in a valid email address in the "Send test email" field to test your configuration. Please do so, in order to test your setup!
- Click "Save configuration" and you are done!
If you see PHP errors on a white background, you probably either forgot to upload the PHP Mailer library, or you did not rename its directory to "phpmailer" (all lowercase!), or this directory is in the wrong location. These errors won't break your Drupal site - they only appear when you try sending a mail.

hey thanx...I followd the
hey thanx...I followd the your steps n I done...!!!!!!
Thanks
Servers now days drop all emails that do not show where the server email comes from, because this is what spamers use. This is why drupal emails might of worked in the past. Anyone on a shared host now needs to do this step. Godaddy's is "relay-hosting.secureserver.net"
Although a little out of date, you saved me a LOT of frustration
I have a D7 install and SMTP Authentication Support module not come with PHPMailer.
See author's comments:
We have a new functional release for D7. Lot's of clean-ups on code have been made, and PHPMailer is now being shipped with it, so it works out-of-the-box. Go test this now!
Thanks very much!!!
thanks buddy
Thanks a lot. It worked for me.
unable to configure it in comapny account
Hi
I tried all above steps..but unable to sentd successfull test mail. I have got my company domain mail id which is directed on Gmail . xxx@mycompanydomain.com
my smtp server setting is -- smtp.gmail.com , port 465 (Please correct me if i m wrong)
use encryption protocol- NO
smtp authentication-- nothing i have put...what should i use if required ?
sender identity -- xxx@mycompanydomain.com (my company mail id)
test maild id-- some other personal id
after saving takes long time and after that it shows --smtp module is active...but there is no test mail...
pls help me in solving this problem where company domain id is used and its already directed to google mail.
thanks
You need SSL for gmail
You need SSL for gmail
thanks a lot!
thanks a lot!
Post new comment