【发布时间】:2012-10-11 20:18:15
【问题描述】:
我正在尝试将 PEAR SMTP 库与 PHP 5.4 一起使用,但在使用它时遇到以下问题:
> Strict Standards: Non-static method Mail::factory() should not be called statically in C:\xampp\htdocs\forgot.php on line 75
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Mail\smtp.php on line 365
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Net\SMTP.php on line 450
Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Net\SMTP.php on line 451
Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Mail\smtp.php on line 369
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Mail\smtp.php on line 249
据我所知,在 PEAR 或 PEAR 脚本的创建者修复它们之前,无法解决此问题。我想知道人们使用哪些替代 SMTP 库,或者我可以做些什么来通过 SMTP 将电子邮件从我的脚本传递到 gmail。我正在使用 Windows,如果有帮助的话。
谢谢。
【问题讨论】:
-
检查这个堆栈溢出。 stackoverflow.com/questions/7114222/…
-
这里是一个帖子,其中包含一个解决方案,方法是在前面加上一个 @。似乎有一些 php4 用法,这对 php5 不是很好,并且没有改变。 stackoverflow.com/questions/8280829/…
-
phpMailer 是一个比 PEAR 中更好的邮件类。我建议切换到那个。