
 nitin sharma - 2009-07-25 11:51:22
Hi
i using this class to read the image attachment and this is working well
now but i facing the problem if some one send a attachment as a video file
i have a question that can i check the content before the message decode if yes what will be be syntex for this please help me about this.
code:
.......
.....
...
if(($error=$pop3->Open())=="")
	{
		echo "<PRE>Connected to the POP3 server "".$pop3->hostname."".</PRE>\n";
		if(($error=$pop3->Login($user,$password,$apop))=="")
		{
			echo "<PRE>User "$user" logged in.</PRE>\n";
			if(($error=$pop3->Statistics($messages,$size))=="")
			{
				echo "<PRE>There are $messages messages in the mail box with a total of $size bytes.</PRE>\n";
				
					$result=$pop3->ListMessages("",0);
				if(GetType($result)=="array")
				{
		for(Reset($result),$message=1;$message<=count($result);Next($result),$message++)
				{
				if($messages>0)
				{
				echo $message;
				
					$pop3->GetConnectionName($connection_name);
					//$message=1;
					$message_file='pop3://'.$connection_name.'/'.$message;
					$mime=new mime_parser_class;
					/*
					* Set to 0 for not decoding the message bodies
					*/
					$mime->decode_bodies = 1;
					$parameters=array(
						'File'=>$message_file,
						/* Read a message from a string instead of a file */
						/* 'Data'=>'My message data string',              */
						/* Save the message body parts to a directory     */
						/* 'SaveBody'=>'/tmp',                            */
						/* Do not retrieve or save message body parts     */
							'SkipBody'=>0,
					);
					$success=$mime->Decode($parameters, $decoded);
						if($mime->Analyze($decoded[0], $results))
						{
   ......
}
....
..
Thank
Nitin