【发布时间】:2013-02-07 17:38:33
【问题描述】:
我已经搜索了 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 设置?我在上面做了什么愚蠢的事情吗?
任何帮助将不胜感激。
干杯。
【问题讨论】:
-
我可能已经找到答案了!在 cPanel 编辑器中编辑 php 文件并删除 hashbang (shebang) 后的换行符,然后重新放入。这摆脱了 windows 新行并添加了 unix 新行!
标签: php email permissions cpanel whm