I don't know whether this is the right place to put this comment, so if there is a better place, feel free to repost this where you think it belongs.
Amazingly, Drupal 4.7 still doesn't have an SMTP Auth capability built in. It is trivial to add it, though, so maybe that is why.
Here is what I did to implement SMTP Auth for my windows installation. I'm not going to pretend that this is the most efficient way of making SMTP Auth work, but it did work for me (after too much trial and error, even after reading all the other documentation and posts I could find here at drupal.org - maybe that says more about me than anything else).
1. Download two include files and put them into the /includes folder. These two files are:
a. smtp.inc
b. class.smtp.inc
I found my /includes folder at c:\program files\apache\www\Drupal\includes
Of course, your installation might find this folder in a different location.
At the time of this writing, these files could be found at:
http://cvs.drupal.org/viewcvs/*checkout*/drupal/contributions/tricks/smt...
and:
http://drupal.org/files/issues/class.smtp.inc
I will also copy these files inline, just to make sure they don't get lost (see below).
2. Modify the settings.php file so that the code in the above include files gets included. I found settings.php in my c:\program files\apache\www\Drupal\sites\default\ folder. Of course, your installation might find this file in a different location.
The specfic modification that I did to my settings.php file was to add the following line:
$conf["smtp_library"]="./includes/smtp.inc";
You can add the line virtually anywhere in the file and it will work.
3. Make sure you stop and restart the apache server and php so that the above settings file takes affect.
4. Modify the smtp.inc file so that it has the information needed.
These are the lines that I confirmed/set:
$params['port'] = 25;
$params['helo'] = $_SERVER['__mysmtpserver__'];
$params['auth'] = TRUE;
$params['user'] = '__emailusername__';
$params['pass'] = '__password__';
where __mysmtpserver__ is replaced with the internet address of your smtp server. It can be a dotted quad (e.g., 10.0.1.2) or a FQDN (e.g., smtp.mydomain.com).
where __emailusername__ is replaced with the name of the user you intend the system to pretend to be so that it can use the smtp server
where __password__ is the plain text password
Be sure to replace both the words and the underscores both before and after.
5. Modify the class.smtp.inc file so that it has the information needed.
These are the lines that I set:
$this->host = '__mysmtpserver__';
$this->port = 25;
$this->helo = '__mysmtpserver__';
$this->auth = TRUE;
$this->user = '__emailusername__';
$this->pass = '__password__';
Yes, I know that it is highly likely that some part of the above changes were redundant.
I can live with that because it just works.
I hope this helps somebody.
Mike
Here is the smtp.inc file:
<?php
// $Id: smtp.inc,v 1.6 2003/12/11 13:59:58 mathias Exp $
include_once 'includes/class.smtp.inc';
function user_mail_wrapper($mail, $subject, $message, $header) {
// The smtp server host/ip
$params['host'] = ini_get('SMTP');
// The smtp server port
$params['port'] = 25;
// What to use when sending the helo command. Typically, your domain/hostname
$params['helo'] = $_SERVER['HTTP_HOST'];
// Whether to use basic authentication or not
$params['auth'] = FALSE;
// Username for authentication
//$params['user'] = 'testuser';
// Password for authentication
//$params['pass'] = 'testuser';
// The recipients (can be multiple)
$send_params['recipients'] = $mail;
// The headers of the mail
$send_params['headers'] = explode("\n", $header ."\nSubject: $subject\nTo: $mail");
// The body of the email
$send_params['body'] = str_replace("\n", "\r\n", $message);
$smtp = smtp::connect($params);
if (count($smtp->errors)) {
watchdog('error', 'mail connect error: '. implode('