所以,最近我从5.3更新到5.5使用新密码hash api;但PEAR邮件现在不能正常工作。
代码:
public function email_user($email, $password) {
date_default_timezone_set('America/Chicago');
require '/usr/share/pear/Mail.php';
$from = 'Matthew Harris <user@domain.com>';
$to = $email;
$subject = 'Lunch Club Password';
$headers = array (
'From' => $from,
'To' => $to,
'Subject' => $subject
);
$smtp = Mail::factory('smtp', array(
'host' => $host,
'auth' => true,
'username' => 'user@domain.com',
'password' => 'password',
));
$mail = $smtp->send($to, $headers, $body);
}
错误日志:
[30-Aug-2014 00:26:16 America/Chicago] PHP Notice: Undefined variable: host in /var/www/html/hserv.org/public_html/inc/core.class.php on line 35
[30-Aug-2014 00:26:16 America/Chicago] PHP Notice: Undefined variable: body in /var/www/html/hserv.org/public_html/inc/core.class.php on line 40
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Mail/smtp.php on line 365
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Net/SMTP.php on line 448
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Net/SMTP.php on line 465
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Net/SMTP.php on line 472
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Net/SMTP.php on line 515
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Net/SMTP.php on line 263
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Net/SMTP.php on line 519
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Mail/smtp.php on line 376
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Net/SMTP.php on line 615
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Net/SMTP.php on line 1266
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Net/SMTP.php on line 263
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Net/SMTP.php on line 1269
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Mail/smtp.php on line 382
[30-Aug-2014 00:26:16 America/Chicago] PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Mail/smtp.php on line 249
邮件日志中没有任何内容,也没有其他任何记录错误。