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
So I've been trying to get this Strict Standards message to not show up.
This is my code:
$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
I've read many Stack Overflow Q&A that say just add a
@ to the beginning of
@$mail =& Mail::factory("smtp", $smtpinfo);
How do I not call the method above as statically?
Even the documentation on this page (http://pear.php.net/manual/en/package.mail.mail.send.php), says
This function cannot be called statically.... but the example they gave is the same way I am calling the method?!
Please don't answer just add
@ in front to remove the strict standard or
E_ALL & ~E_STRICT ... that is not a solution!