首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >sendmail返回错误代码8

sendmail返回错误代码8
EN

Stack Overflow用户
提问于 2013-12-10 14:56:59
回答 1查看 594关注 0票数 1

运行在BlueHost上的简单PHP脚本,其中邮件由Google处理:

代码语言:javascript
复制
<?php
  require_once('Mail.php');
  $subject = 'Test Subject';
  $message = 'Test Message';

  $to = 'to@example.com'; // address on this domain
  $from = 'from@example.com'; // another address on the domain
  $fromname = 'John Doe';

  $headers = array(
    'Return-Path' => $from,
    'From' => $from,
    'X-Priority' => '3',
    'X-Mailer' => 'PHP ' . phpversion(),
    'Reply-To' =>  "$fromname <$from>",
    'MIME-Version' => '1.0',
    'Content-Transfer-Encoding' => '8bit',
    'Content-Type' => 'text/plain; charset=UTF-8',
    'To' => $to,
    'Subject' => $subject
  );

  $params = '-i -v -f ' . $from;
  $sendmail = Mail::factory('sendmail', $params);
  $mail = $sendmail->send($to, $headers, $message);

  if (PEAR::isError($mail)) { $status = $mail->getMessage(); }
?>

$status被设置为sendmail returned error code 8

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-12-10 14:56:59

看来我需要做两件事:

  1. BlueHost检查From:地址是否在cPanel中--即使Google处理邮件。显然,cPanel更新了sendmail的可信用户列表。
  2. 如果To:地址位于同一台主机上,那么它也必须存在于cPanel中,尽管我不知道为什么(sendmail优化?)。
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20497683

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档