嗨'我想轉發所有的電子郵件(這是來到我的收件箱)到PHP腳本和檢索電子郵件內容並將其保存在一個文件中。因此,我正確地使用管道路徑添加了郵件轉發器。電子郵件管道與PHP腳本
地址來轉發:[email protected]
管道的計劃:/home/centuryw/public_html/stage/ana/osticket/upload/api/pipe.php
我用下面的腳本pipe.php
#!/usr/bin/php –q
<?
/* Read the message from STDIN */
$fd = fopen("php://stdin", "r");
$email = ""; // This will be the variable holding the data.
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);
/* Saves the data into a file */
$fdw = fopen("mail.txt", "w+");
fwrite($fdw, $email);
fclose($fdw);
/* Script End */
但有再次反彈到我的收件箱沒有輸出文件和所有的電子郵件。任何人都可以幫助我嗎?
我從來沒有想過pipe'ing。感謝您在我的腦海中創建的進步:) – nerkn 2011-04-08 07:06:49
我只是嘗試將電子郵件轉發到簡單的PHP腳本,並將電子郵件內容寫入文件。我可以使用Cpanel輕鬆添加郵件轉發器。這不是一個愚蠢的想法。 – Chanaka 2011-04-08 08:11:32