PHP Classes

pop3 class error msg

Recommend this page to a friend!

      POP3 e-mail client  >  All threads  >  pop3 class error msg  >  (Un) Subscribe thread alerts  
Subject:pop3 class error msg
Summary:php error : Non-static method pop3_class::SetConnection()
Messages:4
Author:shyam
Date:2009-03-25 09:04:10
Update:2009-04-05 20:46:11
 

  1. pop3 class error msg   Reply   Report abuse  
Picture of shyam shyam - 2009-03-25 09:04:10
Error No: [2048] Non-static method pop3_class::SetConnection() should not be called statically, assuming $this from incompatible context

I get this message for every call to read a message from a pop3 mailbox. Although the mailbox access is successful the script generates these errors and eventually fails. I don't know if the failure is associated with this.

Appreciate any help on this issue.

Thanks,
shyam

  2. Re: pop3 class error msg   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-03-25 22:44:51 - In reply to message 1 from shyam
I am not sure what you are doing. It just tried the browse_mailbox.php example script which calls that function indirectly via the GetConnectionName and it does not issue any errors. Have you tried the browse_mailbox.php example script?

  3. Re: pop3 class error msg   Reply   Report abuse  
Picture of shyam shyam - 2009-04-05 10:16:03 - In reply to message 2 from Manuel Lemos
You're right, I tried the script browse_mailbox.php and did not get that error. So in an attempt to trap script errors I added the following lines to browse_mailbox right after the line "require("pop3.php")"

function customError($errno, $errstr)
{
echo "<b>Error:</b> [$errno] $errstr<br />";
}

set_error_handler("customError");

This is the message I got. I'm running php 5.1.6

--------------------------
<b>Error:</b> [2048] Non-static method pop3_class::SetConnection() should not be called statically, assuming $this from incompatible context<br /><br>
--------------------------

  4. Re: pop3 class error msg   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-04-05 20:46:11 - In reply to message 3 from shyam
Yes, the right way to use the class is to call the GetConnectionName function using an object of the class like in the browser_mailbox.php example, not as a static function.