Page 1 of 2

Troubles with KT_Email.class.php

Posted: 2012-11-07 15:29
by kopchinskiy
Hi All,

I'm new here and love this place already. IMHO MXKollection is (was) the best tool ever created for a small website developer like me.

I can't find solution for the following problem:

User registration form is trying to send confirmation email but fails with a stack of messages (see below).

Server: localhost
PHP: 5.4.7
error_reporting = E_ALL ^ E_STRICT

problem start in line 225 of KT_Email.class.php:
$mail_object = &Mail::factory('smtp', $arrSMTPParameters);

Well, I'm not very good with php so I can't fix this and I also wasn't able to find the was to get rid of this warning.

Is there any solution&idea for this?



Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\includes\common\lib\email\Pear\PEAR.php on line 557
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\includes\common\lib\email\Pear\PEAR.php on line 560
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\includes\common\lib\email\Pear\Mail.php on line 134
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\includes\common\lib\email\Pear\Mail\smtp.php on line 189
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\includes\common\lib\email\Pear\Net\SMTP.php on line 127
Strict Standards: Non-static method Mail::factory() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\includes\common\lib\email\KT_Email.class.php on line 225
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\includes\common\lib\email\Pear\Mail\smtp.php on line 203
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\includes\common\lib\email\Pear\Net\SMTP.php on line 307
Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\includes\common\lib\email\Pear\Net\SMTP.php on line 308
Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\includes\common\lib\email\Pear\Mail\smtp.php on line 207


Many thanks for any help!
Alexey

Re: Troubles with KT_Email.class.php

Posted: 2012-11-08 12:12
by Fred
Hi Alexey,
Did you download the patched files.
Sure the fix is included in there.

Or post the lines of code here so we can take a look.

Re: Troubles with KT_Email.class.php

Posted: 2012-11-08 14:15
by kopchinskiy
Hi Fred,

Sure I did and it solved many problems except this one. I guess it is something to do with PEAR but I'm not quite sure.

Re: Troubles with KT_Email.class.php

Posted: 2012-11-09 09:34
by Fred
Post this line I want to check something.

PEAR.php on line 557

Re: Troubles with KT_Email.class.php

Posted: 2012-11-09 12:52
by kopchinskiy
These are the lines from 549 to 562 of PEAR.php:

Code: Select all

if ($error_class !== null) {
            $ec = $error_class;
        } elseif (isset($this) && isset($this->_error_class)) {
            $ec = $this->_error_class;
        } else {
            $ec = 'PEAR_Error';
        }
        if ($skipmsg) {
            $a = &new $ec($code, $mode, $options, $userinfo);
            return $a;
        } else {
            $a = &new $ec($message, $code, $mode, $options, $userinfo);
            return $a;
        }
Do you see anything special here?

Re: Troubles with KT_Email.class.php

Posted: 2012-11-09 14:12
by Fred
yes there are mistakes in the code.

Download this zip file here. It is my current files.
http://www.interaktonline.info/download ... nload.html

Note:
My settings is not set to error_reporting = E_ALL ^ E_STRICT so there might be more warnings.
Please let me know.

Re: Troubles with KT_Email.class.php

Posted: 2012-11-09 16:26
by kopchinskiy
Hi Fred,

Thanks for the code! It didn't help though: email is still not send. I set php.ini to E_ALL so here is the error I'm getting right now:

Code: Select all

Strict Standards: Non-static method Mail::factory() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\includes\common\lib\email\KT_Email.class.php on line 223

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\includes\common\lib\email\Pear\Mail\smtp.php on line 203

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\includes\common\lib\email\Pear\Net\SMTP.php on line 307

Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\includes\common\lib\email\Pear\Net\SMTP.php on line 308

Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\includes\common\lib\email\Pear\Mail\smtp.php on line 207
My php is 5.4.7 and PEAR seems to be enabled (as I see from phpinfo).
Well, this is not a disaster for me so if this takes you really much effort I don't mind if you leave it as it is. On my destination hosting (Lunarpages) with php 5.3.15 everything works just fine. phpinfo there doesn't show any PEAR. I guess they have some alternative installed on their servers (Phar?).

Many thanks for your time!
Alexey

Re: Troubles with KT_Email.class.php

Posted: 2012-11-09 21:55
by Fred
No we need to fix it.
Will take a look at the issue.

Re: Troubles with KT_Email.class.php

Posted: 2012-11-09 23:00
by Fred
Change this line
C:\xampp\htdocs\includes\common\lib\email\KT_Email.class.php on line 223

from

Code: Select all

$mail_object = &Mail::factory('smtp', $arrSMTPParameters);
to

Code: Select all

$mail_object = Mail::factory('smtp', $arrSMTPParameters);
The isError() instances is a pear issue that I will look into.
Changing the display_errors value in the php.ini to "Off" suppressed these errors.
See this list here http://www.gossamer-threads.com/lists/w ... ded#305625

Re: Troubles with KT_Email.class.php

Posted: 2016-01-17 21:28
by al3abmizo
Hi Fred,
Thanks for your kind help, My name is Waleed Barakat, i was posting InterAKT online and ADDT development tutorials in Adobe ADDT forums, if you didn't remember me forget this.

Anyway i am facing the same problem when sending emails with this details:

Code: Select all

[17-Jan-2016 14:18:24 CST6CDT] PHP Strict Standards:  Non-static method Mail::factory() should not be called statically, assuming $this from incompatible context in /home/al3abmi/public_html/hannywbarek.com/includes/common/lib/email/KT_Email.class.php on line 229

[17-Jan-2016 14:18:24 CST6CDT] PHP Strict Standards:  Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /home/al3abmi/public_html/hannywbarek.com/includes/common/lib/email/Pear/Mail.php on line 136

[17-Jan-2016 14:18:24 CST6CDT] PHP Strict Standards:  Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /home/al3abmi/public_html/hannywbarek.com/includes/common/lib/email/Pear/Mail/mail.php on line 103
I have tried the help you offered but it seems not working, Any suggestions?