
 Diana Parvanova - 2017-07-21 14:07:14 - 
In reply to message 2 from Manuel LemosThank you!
I did try to do it with file_get_contents() but I get FALSE as result.
Here is my code (without error handling for simplification ). Can you please review it and tell me what do I do wrong!
Thank you!
stream_wrapper_register('mlpop3', 'pop3_stream');
$pop3=new pop3_class;
//here I set user, pass, server ets.
$pop3->Open();
$pop3->Login($user,$password,$apop);
$pop3->Statistics($messages,$size);
$pop3->GetConnectionName($connection_name);
for ($message=1; $message <= $messages; $message++){
	$message_id = $pop3->ListMessages($message, 1);
	$message_file='mlpop3://'.$connection_name.'/'.$message;
	$mime=new mime_parser_class;
	$parameters=array(
		'File'=>$message_file,
		'SkipBody'=>0,
	);
	$mime->Decode($parameters, $decoded);
	$mime->Analyze($decoded[0], $results);
	echo $message_id . "----" .$results['Subject']. "<br>"; // this is OK
	//do some parsing here
	if(!$parsed_successfully){
		$f = file_get_contents($message_file); 
		var_dump($f);// here the result is FALSE
	}
}
$pop3->Close()