dsedug8644 2014-12-11 12:15
浏览 259
已采纳

用PHP管道电子邮件

I would like to pipe email through a PHP script.

To be recognized has a script to be execute by Shell, I've put that line a the begining of my file: #!/usr/bin/php -q

I've enabled PHP's Mail Parse extension.

I have 2 issues:

  1. If I move my script into a sub directory, any email can't be piped, despite of the new valid patch set in my c-panel (Seems like PHP IO stream can't be read in sub directories?). Otherwise, I can pipe email in /public_html (where my php.ini file is), but I'm still unable to call a Mail Parse's function that directory.

  2. My script seems to use another php.ini file, because when I call a function from Mail Parse, PHP warns me that the function is undefined (if I use another script manually, in the same directory and same code, all works and there's no warning.). I've put that line to use a specific php.ini file #!/usr/bin/php -c /homeXX/XXXX/public_html/php.ini. It didn't worked.

Thanks for any answer, it'll be very appreciated.

  • 写回答

2条回答 默认 最新

  • doujiacai4986 2014-12-15 19:13
    关注

    UPDATE: Depending of server configuration, you have to avoid space between command line option (-c) and path (/path/to/script). That solution worked in my case!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表