View Issue Details

IDProjectCategoryView StatusLast Update
0004756phplist applicationMessage Send Processpublic10-01-11 01:38
Reporterafx114 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.10.2 
Target Version2.10.7Fixed in Version2.10.7 
Summary0004756: PHPMailer doesn't properly include its language files.
DescriptionMany people are experiencing errors with the PHPMailer class but they are extremely difficult to track down because its language files aren't properly included. No proper error messages are printed from PHPMailer because of this.

A sample error is:
"Mailer Error: Language string failed to load: instantiate"

The reason is because while class.phplistmailer is instantiated in /admin, its parent class (class.phpmailer) is instantiated in /admin/phpmailer, so PHPMailer ends up looking for its language files in /admin/language, which of course does not exist.

This is a VERY trivial fix. Simply add the following to line 24 of /admin/class.phplistmailer.php:

parent::SetLanguage('en','phpmailer/language/');

By passing in that optional second parameter, we allow PHPMailer to finds its language files, which is ABOSULUTELY VITAL to tracking down and solving problems with sending mail.

I have made this change and tested it on my own 2.10.2 install and it works great. I can now see the errors PHPMailer is encountering. I don't have the time to get a CVS account, but can someone patch and test this and please check it in if it works for you! Thanks.
TagsNo tags attached.

Relationships

related to 0003721 closed phplist 2.10.x 
has duplicate 0002010 closed PHPMailer modification to get around SMTP Mailer Error 
has duplicate 0005385 resolvedmichiel Mailer Error: Language string failed to load: instantiate 
has duplicate 0006331 resolvedmichiel Mailer Error: Could not instantiate mail function 

Activities

michiel

21-11-05 15:54

manager   ~0008799

on the phpmailer mailinglist this issue came up and I thought I'd fixed it by hacking phpmailer to load the correct language files (using dirname(__FILE__) to reference the language files). Sounds like it didn't. Will update for next release

user1177

09-02-06 19:21

  ~0010516

Here's a possible solution from the forums http://www.phplist.com/forums/viewtopic.php?p=14332#14332

IN CLASS.PHPLISTMAILER:PHP LINE #4 change this:

require( $GLOBALS"coderoot"] . "phpmailer/class.phpmailer.php");

FOR:

require( $GLOBALS["coderoot"] . "/phpmailer/class.phpmailer.php");

michiel

26-04-06 21:39

manager   ~0013090

have fixed this is CVS, but I couldn't recreate the errors, so it's hard to check that it actually fixed the problem. I was able to send via authenticated SMTP though, so it didn't break anything, presumably.

theintoy

27-10-07 09:48

reporter   ~0035392

I still had issues in 2.10.5. Having looked through the code and following other fixes I have changed line 24 to:
[code]
 parent::SetLanguage('en',dirname(__FILE__) . '/phpmailer/language/');
[/code]

This appears to have resolved the i18n issue for me

alfredo_tripicchio

08-04-08 10:58

reporter   ~0044334

Hi everybody, here is what I found out:

Version 2.10.2
applied patch from http://mantis.tincan.co.uk/view.php?id=4756
to file lists/admin/class.phplistmailer.php, line 24
substituted
parent::PHPMailer();
with
parent::SetLanguage('en','phpmailer/language/');

Version 2.10.5
the patch has been included, but still does not work.
This is because now I have this in lists/config/config.php
define("PHPMAILER",1);
whereas I had
define("PHPMAILER",0);
in older installations, so I never really tested the patch before (duh!)

Version 2.10.5
I applied the patch from theintoy (thank you mate!)
substituted
parent::SetLanguage('en','phpmailer/language/');
with
parent::SetLanguage('en',dirname(__FILE__) . '/phpmailer/language/');

and IT WORKS!

user1308

08-04-08 14:40

  ~0044364

Applied for v2.10.6