Email piping with php script

前端 未结 5 1558
深忆病人
深忆病人 2021-02-03 13:19

Hi\' I want to forward all the emails(which are come to my inbox) to php script and retrieve email content and save it in a file. So do that I was add email forwarder with pipin

相关标签:
5条回答
  • 2021-02-03 14:01

    If this is actually an email box, why not use IMAP (PHP)? There are lots of classes to read the mail with imap @ phpclasses.org

    0 讨论(0)
  • 2021-02-03 14:14

    I know this question is 2 years old but hopefully this will help anybody who stumbles across it as I did.

    I had exactly the same issue and I spent ages trying to log errors etc. I then noticed that my script (and this one) had PHP short tags (i.e. <?) and my PHP config file had these turned off. I changed the tag to <?php and the script worked! Obvious but easy to miss...

    0 讨论(0)
  • 2021-02-03 14:17

    Make sure the PHP file has the execute bit set (i.e. chmod +x pipe.php).

    0 讨论(0)
  • 2021-02-03 14:20

    Chanaka -

    This doesn't address why there is no output file, but...

    Don't you want to use a+ in your fopen() call? The w+ argument will delete any content that already exists in your output file.

    PS: Have you tried doing a simple test which writes to the output file using dummy text (not the input from an e-mail) as the contents?

    Jeff Cohan

    0 讨论(0)
  • 2021-02-03 14:22

    try the following 2 options to check:

    • First, your php file must need to have execute permission(from owner group at least), otherwise it won't work.

    • What did you used when you were using forwarder? You need to mention php compiler path at the beginnig also.

    I have recently written an article regarding the full detail process of piping email content to php program , you will may like to have a look. Let me know if you have any more question. Thanks.

    0 讨论(0)
提交回复
热议问题