ERRNO:尝试发送邮件时为8192 [英] ERRNO: 8192 when trying to send mail

查看:72
本文介绍了ERRNO:尝试发送邮件时为8192的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将其放在任何空白的php页面中时,我有以下代码可以工作,但是当我尝试将代码置于我已经具有某些代码的另一个php页面中时,我得到了错误:

I have the following code which works when i put it in any blank php page,but when i try to put the code in another php page where i already have some codes in it, i get the error:


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"=>"xyz@gmail.com", "Subject"=>"Your order has been placed   ");
        $body = "lol";
        $mail->send("abc@live.com", $headers, $body);


推荐答案

您可能有旧版本的PEAR :: Mail 。可能是版本1.1.14,是当前稳定版本1.2.0之前的最后一个稳定版本。

You probably have an old version of PEAR::Mail. Could be version 1.1.14, the last stable version before the current stable version 1.2.0.

尝试

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

以获取最新版本。

编辑:这实际上不是答案的一部分,但不会不能在注释中加上以下内容:

edit: This is not actually part of the answer but doesn't fit in a comment either:

出于调试目的,将pear / Mail.php中的工厂函数替换为

For debugging purposes replace the factory function in pear/Mail.php by

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);
  }
}

这篇关于ERRNO:尝试发送邮件时为8192的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆