2012-10-22 68 views
5

我試圖使用PEAR SMTP庫PHP 5.4,但我有以下問題時使用它:PHP 5.4和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 

據我所知,沒有修復爲此,直到PEAR或PEAR腳本的創建者修復它們。我想知道人們使用什麼替代SMTP庫,或者我可以通過SMTP將郵件從我的腳本傳遞到Gmail。我使用Windows,如果有任何幫助。

謝謝。

+1

檢查此堆棧溢出。 http://stackoverflow.com/questions/7114222/what-is-wrong-with-this-php-script-to-send-mail-using-pear-mail –

+0

也檢查了這個論壇張貼。 http://forums.phpfreaks.com/topic/255144-pear-mail-problems/ –

+0

這裏是一個貼子,其中包含一個解決方案,前面加上@。它似乎有一些php4的用法,這是不是很好的php5,並沒有改變。 http://stackoverflow.com/questions/8280829/sending-mail-using-php-and-pear-on-windows –

回答

1

請使用php郵件程序庫。這將幫助您解決PHP中的任何電子郵件相關問題。

以下是phpmail庫 http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list

在zip格式的下載鏈接庫是可用的。

提取zip後請搜索測試文件夾。這將向您演示如何使用該庫。

您也可以參考link使用Gmail電子郵件通信

謝謝!