I had forgotten to install PHPMailer correctly (I had the dir as PHPMailer_v5.1) so when i tried to send test messages the class initialization at smtp.module line 252 would fail and kill the whole site. There should be some kind of test to make sure that PHPMailer is there and installed correctly before proceeding. If not issue warning and pass out of the script and allow the rest of the page to display (if that can happen).

error message:
Fatal error: require_once() [function.require]: Failed opening required 'sites/all/modules/smtp/phpmailer/class.phpmailer.php' (include_path='.:/usr/share/php:/home/chriss/www_projects/lib/fblib') in xxx/drupal/sites/all/modules/smtp/smtp.module on line 252

i don't want to entangle myself in your project but, a test for " if (file_exists('./phpmailer/class.phpmailer.php')) { " maybe in order.

Anyway thanks for listening, Chris

Comments

simon georges’s picture

The module PHPMailer handles it using hook_requirements(). I think it's the perfect approach, the thing is, the two modules seem to be getting closer every day ;)

So rather than just copy-pasting its code, maybe it is time to pay more attention to #878334: SMTP Authentication vs. PHPMailer module.

Regards,

iwps’s picture

I've seen this too, but it appears to be a problem *only* if you select "Hide Password" in the PHPMailer "SMTP authentication" setup screen. IMO, every time you perform a test email on that screen, the missing/blank password field wipes out the password in the DB.

To make the password visible, edit the table "variable" and the field "smtp_hide_password". Change the "1" to a "0".

Update: I stand corrected:

- Remove "SMTP Authentication Support"...you don't need it and it screws up

- Use "PHPMailer". Works great .

geerlingguy’s picture

Agreeing with #2. Subscribing...

BrockBoland’s picture

Status: Active » Closed (duplicate)

This was fixed as #541942: Move PHPMailer out of the module folder, check for class already defined. The fix is in the dev branch but there hasn't been a release since it was added.