dsj2222222 2016-05-01 15:37
浏览 101

Sendmail无法发送到某些域

I've got a small site set up that allows people to send a prewritten email to their representatives, by putting in their own email and their representatives email. It's set up using sendmail, and works for sending to gmail, a personal email I have, and various other domains. However, it fails to send to the one domain that I need it to send to. I get the following fault

<www-data@localhost.localdomain>: Sender address rejected: Domain not found

I've been looking through god knows how many things and I can't seem to figure it out seeing as it's working for everything else.

Hopefully someone can explain it. Cheers!

<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_recipient = $_POST['cf_recipient'];

$subject = 'Message Regarding Cuts in the Mental Health Budget';

$body_message = 'hello';

$headers = 'From: '.$field_email."
";

$headers .= 'Reply-To: '.$field_email."
";
$headers .= 'Return-Path: '.$field_email;

$mail_status = mail($field_recipient, $subject, $body_message, $headers);

if ($mail_status) { ?>
    <script language="javascript" type="text/javascript">
        alert('Thank you for the message. We hope this will get the TDs in gear.');
        window.location = 'index.html';
    </script>
<?php
}
else { ?>
    <script language="javascript" type="text/javascript">
        alert('Message failed. Please, make sure all boxes have been filled and try again.');
        window.location = 'index.html';
    </script>
<?php
}
?>
  • 写回答

1条回答 默认 最新

  • douyi02577 2016-05-01 16:01
    关注

    You have failed to set "envelope sender" email address used in MAIL FROM: command in SMTP sessions. It can be set by passing -f command line option to sendmail. See additional_parameters in mail documentation

    评论

报告相同问题?

悬赏问题

  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口