After having dificulting with SMTP email support and failing to enable smtp.class-1.0.5.tar.gz solution, I created the following smtp_library which uses phpmailer. This solution is working great on my Linux box so I thought I'd share with the rest of the world.

CommentFileSizeAuthor
phpmailer.zip1.29 KBrinehart
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ax’s picture

shouldn't this go into http://cvs.drupal.org/viewcvs/contributions/tricks/ ? not sure anyone will find in here.

IamPter’s picture

Version: » 4.6.0

I imagine this will not work with 4.6.2? If not is there another solution for drupal to send email with smtp auth and such?

lotherius’s picture

THIS WORKS!

tbox’s picture

Project: Drupal core »
Version: 4.6.0 » 4.6.3
Component: base system » other

Phpmailer works but what I dont understand is why it didnt explain how it works or the difference from class.smtp? Any reason why drupal itself couldnt handle my outgoing emails via my Exchange?

This is all on my MS WinXP+apache1.3+MySQL3.23+php4+drupal4.6.3

1. extracted phpmailer.zip to c:\temp
2. created the folder phpmailer under the drupal\include directory
3. copied the two files to drupal\include
4. restarted apache (was this needed?)
5. Send email

And it works.

Nicholas

sbirnie’s picture

you didn't have to edit any config file to get it to work?

paddywwoof’s picture

Title: Another SMTP "Trick" » Another SMTP "Trick" (w.r.t. simplenew module)

I had to resort to phpmailer to get email working on a site using shared hosting on IIS see:
http://drupal.org/node/29888#comment-60793
however I had trouble with simplenews and in the end I had to change the simplenews.module by:
- replacing the body of the function sn_mail_send with essentially the content of phpmailer.inc (see below) and
- replaceing the variable $mail with $snmail so it didn't conflict with the variable of the same name in phpmailer.

There are probably better ways of doing this

/**
* Mail engine
*/
function sn_mail_send($snmail) {
$snmail->to = trim($snmail->to);
include_once 'includes/phpmailer.inc';
return user_mail_wrapper($snmail->to, $snmail->title, $snmail->message, '');
}

paddy http://www.eldwick.org.uk/

gorlok’s picture

This works fine for me! This help me a lot!

My setup:

  • Apache 2 on WinXP
  • PHP 5.0.5
  • Drupal 4.6.3
  • Yahoo Mail Account.

THANK YOU GUYS!!!

-Gorlok@Argentina

peekj’s picture

Works for me on 4.7b4 but it does throw an error with headers, so the next page does not load...

orundg’s picture

I have version 4.6.5 and fixed my header errors by deleting the blank lines at the end of phpmailer.inc

crashpoint’s picture

i tried out this patch and it worked. Thanks a lot

bigbman’s picture

Did anyone ever get this working to support multiple recipients? Does it matter in Drupal (does it send emails one by one)?

leed’s picture

Title: Another SMTP "Trick" (w.r.t. simplenew module) » "Class 'PHPMailer' not found" error message

I am getting
Fatal error: Class 'PHPMailer' not found in C:\XAMPP\xampp\htdocs\xampp\drupal\includes\phpmailer.inc on line 5
message.
What did I do wrong?

Amazon’s picture

This is not an User experience issue. Use the support forums.

Make a file with this:

phpinfo();
?>

Then look to see if you have mail options included you PHP.

cosmicdreams’s picture

Status: Active » Closed (fixed)

No response after a year. Closing.