27 February 2011, 1:48 AM

Simple code to allow you to pipe an email to PHP using Forwarder setup with cPanel. You can use by setting up a new Forwarder and using Advanced options.

To pipe you will need to enter this in the box requires changing the root to your PHP file.

/usr/bin/php -q /home/user1/scripts/pipemail.php

pipemail.php must have permission 0775

Contents of pipemail.php are as followed 

#!/usr/bin/php -q

// read from stdin

$fd = fopen("php://stdin", "r");

$email = "";

while (!feof($fd)) {

    $email .= fread($fd, 1024);

}

$lines = explode("\n", $email);

$myFile = "contentsOfMail.txt";

$fh = fopen($myFile, 'w') or die("can't open file");

fwrite($fh, $email);

fclose($fh);

?>




We have a large portfolio of work we have completed for clients. Our portfolio always carries our current new iPhone applications. Take a look

Follow us on Twitter, We aim to provide Live Information - @olliekett
 



© OKD Limited 2012 | Contact Us
OKD Limited is a private registered company in England and Wales.
 
Ollie Kett Designs - Tracking System