Login   Register  
PHP Classes
elePHPant
Icontem

STDIN mail not working with mail_parser classe !?

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      POP3 e-mail client  >  POP3 e-mail client package blog  >  Process incoming e-ma...  >  All threads  >  STDIN mail not working with mail_parser classe !?  >  (Un) Subscribe thread alerts  
Subject:STDIN mail not working with mail_parser classe !?
Summary:Issue with Parser & STDIN
Messages:3
Author:Rico
Date:2012-02-06 11:28:37
Update:2012-02-07 20:08:37
 

  1. STDIN mail not working with mail_parser classe !?   Reply   Report abuse  
Picture of Rico
Rico
2012-02-06 11:28:38

Hi !

And thx for this brilliant classes and for all the explanations.

Your parser & example work well and I 'm now less a newbie in PHP ;) and I get all mails attachement (& inline) in the folder tmp !

Regarding now the whole process to implement, I have one issue when getting the file using STDIN and your method :

FYI my STDIN is working well, with other Php script on my server (Php5)

- I first tried your approach : $message_file = file_get_contents("php://stdin");
and nothing in the folder tmp

- Then I tried my method working in my other script, but not working with your class
$message_file = '';
$file = fopen('php://stdin', 'r');
while(!feof($file))
{
$message_file .=fgets($file, 1024);
}
fclose($file);

I tried also with pointer...but no result.

Could you give me your feedbacks/help ?
Thx

Rico

  2. Re: STDIN mail not working with mail_parser classe !?   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2012-02-06 22:24:18 - In reply to message 1 from Rico
If you are basing your scripts in the parse_message.php script, $message_file is the file name, not the file contents, so it should be just 'php://stdin'.

  3. Re: STDIN mail not working with mail_parser classe !?   Reply   Report abuse  
Picture of Rico
Rico
2012-02-07 20:08:37 - In reply to message 2 from Manuel Lemos
Hi Manuel !

And thank you for your quick answer !
Absolutely right, and thx again!

For mail piping : you have to "comment" file_message" parameter & "uncomment" data_file ;)

Another tips for developer, don't forget to chmod 777 your "TMP" folder where attachement will be store... 5 hours lost...

Best,

Rico