I am using pear to send mail in PHP. I've followed the example that is on here (http://pear.php.net/manual/en/package.mail.mail.send.php). However, I am getting this error message.
Strict Standards: Non-static method Mail::factory() should not be called statically in C:\xampp\htdocs\functions.php on line 43
$smtpinfo["host"] = "********";
$smtpinfo["port"] = "587";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = $mail_username;
$smtpinfo["password"] = $mail_password;
## This line below is causing the problem ##
$mail =& Mail::factory("smtp", $smtpinfo); // <-- Line 43
@$mail =& Mail::factory("smtp", $smtpinfo);
This function cannot be called statically.
E_ALL & ~E_STRICT
If you take a look at the PEAR Mail class, you can see that there are a few instances of it calling methods statically when the methods are not declared as static.
Change line 74 of
function &factory($driver, $params = array())
static function &factory($driver, $params = array())
The other less desirable alternative would be to modify your
php.ini configuration to disregard the
E_STRICT warnings, but I believe fixing the cause of the error message is better than hiding it.