dqt66847 2018-07-09 00:21
浏览 73

PayPal IPN显示正常,但sendmail不会发送电子邮件

On the PayPal IPN simulator, it shows that "IPN was sent and the handshake was verified.".

My IPN works, but the code in it doesn't.

<?php namespace Listener;
error_reporting(E_ALL); // To investigate errors, 100% useless
ini_set("log_errors", TRUE); // To investigate errors, 100% useless
ini_set("error_log", "/tmp/php-error.log"); // To investigate errors, 100% useless
require('PaypalIPN.php');
use PaypalIPN;
$ipn = new PaypalIPN();
$ipn->useSandbox(); 
$verified = $ipn->verifyIPN();
if ($verified) {
$to      = 'xxxxxxxxxx';
$subject = 'xxxxxxxxxx';
$message = 'xxxxxxxxxx';
$headers = 'From: xxxxxxxxxx' . "
" .
'Reply-To: xxxxxxxxxx' . "
" .
mail($to, $subject, $message, $headers); //supposed to send an email when someone successfully donates
}
header("HTTP/1.1 200 OK");

I also tried sendgrid and it didn't work either. Nothing shows up in PHP error logs.

The thing that kills me is that the mail code works outside of the if statement.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 comsol稳态求解器 找不到解,奇异矩阵有1个空方程返回的解不收敛。没有返回所有参数步长;pid控制
    • ¥15 怎么让wx群机器人发送音乐
    • ¥15 fesafe材料库问题
    • ¥35 beats蓝牙耳机怎么查看日志
    • ¥15 Fluent齿轮搅油
    • ¥15 八爪鱼爬数据为什么自己停了
    • ¥15 交替优化波束形成和ris反射角使保密速率最大化
    • ¥15 树莓派与pix飞控通信
    • ¥15 自动转发微信群信息到另外一个微信群
    • ¥15 outlook无法配置成功