【问题标题】:SMTP Error: The following recipients failed: SMTP Error: The following recipients failedSMTP 错误:以下收件人失败:SMTP 错误:以下收件人失败
【发布时间】:2019-10-23 10:20:31
【问题描述】:

我在 PHP 站点上使用以下 class.phpmailer.php 文件作为注册系统的一部分,但出现以下错误。

我已经将我的 phpmailer 文件的顶部连同底部的错误消息一起放入了我在实时网站上提交表单后看到的错误消息。

  /////////////////////////////////////////////////
  // PROPERTIES, PUBLIC
  /////////////////////////////////////////////////
  /**
   * Email priority (1 = High, 3 = Normal, 5 = low).
   * @var int
   */
  public $Priority          = 3;
  /**
   * Sets the CharSet of the message.
   * @var string
   */
  public $CharSet           = 'iso-8859-1';
  /**
   * Sets the Content-type of the message.
   * @var string
   */
  public $ContentType       = 'text/plain';
  /**
   * Sets the Encoding of the message. Options for this are
   *  "8bit", "7bit", "binary", "base64", and "quoted-printable".
   * @var string
   */
  public $Encoding          = '8bit';
  /**
   * Holds the most recent mailer error message.
   * @var string
   */
  public $ErrorInfo         = '';
  /**
   * Sets the From email address for the message.
   * @var string
   */
  public $From              = 'noreply@domain.co.uk';
  /**
   * Sets the From name of the message.
   * @var string
   */
  public $FromName          = 'Name';
  /**
   * Sets the Sender email (Return-Path) of the message.  If not empty,
   * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
   * @var string
   */
  public $Sender            = 'noreply@domain.co.uk';
  /**
   * Sets the Subject of the message.
   * @var string
   */
  public $Subject           = '';
  /**
   * Sets the Body of the message.  This can be either an HTML or text body.
   * If HTML then run IsHTML(true).
   * @var string
   */
  public $Body              = '';
  /**
   * Sets the text-only body of the message.  This automatically sets the
   * email to multipart/alternative.  This body can be read by mail
   * clients that do not have HTML email capability such as mutt. Clients
   * that can read HTML will view the normal Body.
   * @var string
   */
  public $AltBody           = '';
  /**
   * Stores the complete compiled MIME message body.
   * @var string
   * @access protected
   */
  protected $MIMEBody       = '';
  /**
   * Stores the complete compiled MIME message headers.
   * @var string
   * @access protected
   */
  protected $MIMEHeader     = '';
  /**
   * Stores the complete sent MIME message (Body and Headers)
   * @var string
   * @access protected
  */
  protected $SentMIMEMessage     = '';
  /**
   * Sets word wrapping on the body of the message to a given number of
   * characters.
   * @var int
   */
  public $WordWrap          = 0;
  /**
   * Method to send mail: ("mail", "sendmail", or "smtp").
   * @var string
   */
  public $Mailer            = 'smtp';
  /**
   * Sets the path of the sendmail program.
   * @var string
   */
  public $Sendmail          = '/usr/sbin/sendmail';
  /**
   * Path to PHPMailer plugins.  Useful if the SMTP class
   * is in a different directory than the PHP include path.
   * @var string
   */
  public $PluginDir         = '';
  /**
   * Sets the email address that a reading confirmation will be sent.
   * @var string
   */
  public $ConfirmReadingTo  = '';
  /**
   * Sets the hostname to use in Message-Id and Received headers
   * and as default HELO string. If empty, the value returned
   * by SERVER_NAME is used or 'localhost.localdomain'.
   * @var string
   */
  public $Hostname          = 'mail.domain.co.uk';
  /**
   * Sets the message ID to be used in the Message-Id header.
   * If empty, a unique id will be generated.
   * @var string
   */
  public $MessageID         = '';

直到最近一切正常。

我已尝试对脚本进行各种更改,但似乎无法修复此错误。

我得到的错误是:

SMTP -> FROM SERVER:250 OK 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "501 <>: missing or malformed local part " 
SMTP -> get_lines(): $data is "501 <>: missing or malformed local part " 
SMTP -> FROM SERVER:501 <>: missing or malformed local part 
SMTP -> ERROR: RCPT not accepted from server: 501 <>: missing or malformed local part 
SMTP Error: The following recipients failed: SMTP Error: The following recipients failed:
SMTP server error: <>: missing or malformed local part

【问题讨论】:

    标签: php email phpmailer


    【解决方案1】:

    您使用的 PHPMailer 版本非常旧且有问题。 Update to the latest version,并将您的代码基于随附的示例。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-24
      • 1970-01-01
      • 1970-01-01
      • 2016-06-16
      • 2013-09-01
      • 1970-01-01
      • 2016-11-13
      相关资源
      最近更新 更多