我正在尝试使用PHP 5.4的PEAR SMTP库,但在使用它时遇到以下问题:
> 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
Run Code Online (Sandbox Code Playgroud)
据我所知,在PEAR或PEAR脚本的创建者修复它们之前,没有解决方法.我想知道人们使用什么替代SMTP库,或者我可以做些什么来从我的脚本通过SMTP向gmail发送电子邮件.我正在使用Windows,如果有任何帮助的话.
谢谢.
请使用 php 邮件程序库。这将帮助您解决 PHP 中任何与电子邮件相关的问题。
以下是phpmail库的下载链接 http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list
该库以 zip 格式提供。
请在解压 zip 后搜索 test 文件夹。这将向您演示如何使用该库。
您还可以参考使用 gmail 进行电子邮件通信的链接
谢谢!