繁体   English   中英

管理电子邮件到PHP脚本

[英]Piping email to php script

我一直在寻找2天的答案并找到了这么多,但仍然无法让这个工作。

我有一个带有cPanel帐户的WHM服务器。

我在/home/USERNAME/help-system/parse.php的public_html下创建了以下php脚本进行测试:

#!/usr/local/bin/php -q
<?php
mail('****@davidslack.co.uk', 'Test email', 'Test email to get an email into the script');
?>

我还在cPanel中创建了一个转发到以下内容的转发器:

|/home/USERNAME/help-system/parse.php

php脚本和目录有权限0755(也尝试过0777)

现在,当我向正确的地址发送电子邮件时,我会收到一封反弹电子邮件:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

  pipe to |/home/USERNAME/help-system/parse.php
    generated by *********@davidslack.co.uk
    local delivery failed

The following text was generated during the delivery attempt:

------ pipe to |/home/USERNAME/help-system/parse.php
       generated by *********@davidslack.co.uk ------

Extension '/home/USERNAME/help-system/parse.php' not present.

------ This is a copy of the message, including all the headers. ------

我错过了什么? 是否有WHM或cPanel设置我还没有启用? 我上面做过些蠢事吗?

任何帮助将非常感激。

干杯。

电子邮件管道,看起来无法理解windows换行!

所以:

  1. 创建PHP脚本
  2. 将hashbang添加到脚本的顶部
  3. 上传
  4. 在cPanel中打开 - >文件管理器 - >代码编辑器
  5. 在hashbang之后删除换行符并将其重新添加

一切正常

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM