2010-04-10 22 views
0

我有下面的代碼,當我把它放在任何空白的PHP頁面,但當我嘗試把代碼放在另一個PHP頁面,其中我已經有一些代碼在其中,我得到的錯誤:ERRNO:8192當試圖發送郵件

ERRNO: 8192 
TEXT: Assigning the return value of new by reference is deprecated 
LOCATION: C:\xampp\php\PEAR\Mail.php, line 154, 
include('Mail.php'); 
     $mail = Mail::factory("mail"); 

     $headers = array("From"=>"[email protected]", "Subject"=>"Your order has been placed "); 
     $body = "lol"; 
     $mail->send("[email protected]", $headers, $body); 

回答

1

你可能有一箇舊版本的PEAR ::的郵件。可能是版本1.1.14,是當前穩定版本1.2.0之前的最後一個穩定版本。

嘗試

pear channel-update pear.php.net 
pear upgrade Mail 

以獲取最新版本。


編輯:這不是真正的答案的一部分,但不適合在評論之一:

出於調試目的更換出廠功能梨/ Mail.php通過

function &factory($driver, $params = array()) 
{ 
    $driver = strtolower($driver); 
    echo '<pre>Debug: driver=', $driver, "</pre>\n"; 
    echo '<pre>Debug: include_path=', get_include_path(), "</pre>\n"; 
    echo '<pre>Debug: cwd=', getcwd(), "</pre>\n"; 
    echo '<pre>Debug: __FILE__=', __FILE__, "</pre>\n"; 

    require_once 'Mail/' . $driver . '.php'; 
    $class = 'Mail_' . $driver; 
    if (class_exists($class)) { 
    $mailer = new $class($params); 
    return $mailer; 
    } 
    else { 
    throw new Exception('Unable to find class for driver ' . $driver); 
    } 
} 
+0

我在哪裏輸入以上內容? – chupinette 2010-04-10 08:34:42

+0

在命令行中。你是如何獲得你已有的PEAR :: Mail版本的?你沒有使用'pear install Mail'嗎? – VolkerK 2010-04-10 08:38:15

+0

不..我安裝了xampp。 – chupinette 2010-04-10 08:52:13

相關問題