function GetAttachments($msgno, $include_raw_data = true)
	{
		$struct = imap_fetchstructure($this->mbox,$msgno);
		$contentParts = count($struct->parts);
		$attachments = array();

		if ($contentParts >= 2) 
		{
			for ($i=2;$i<=$contentParts;$i++) 
			{
				$att[$i-2] = imap_bodystruct($this->mbox,$msgno,$i);
				// these extra bits help us later...
				$att[$i-2]->x_msg_id = $msgno;
				$att[$i-2]->x_part_id = $i;
			}
			
			for ($k=0;$k<sizeof($att);$k++) 
			{
				if ( strtolower($att[$k]->parameters[0]->value) == "us-ascii" && $att[$k]->parameters[1]->value != "") 
				{
					$attachments[$k] = $this->_getPartFromStruct($att[$k],$include_raw_data);
				} 
				elseif ( strtolower($att[$k]->parameters[0]->value) != "iso-8859-1" ) 
				{
					$attachments[$k] = $this->_getPartFromStruct($att[$k],$include_raw_data);
				}
			}
		}
		
		return $attachments;
	}
function GetAttachments($msgno, $include_raw_data = true)
	{
		$struct = imap_fetchstructure($this->mbox,$msgno);
		$contentParts = count($struct->parts);
		$attachments = array();

		if ($contentParts >= 2) 
		{
			for ($i=2;$i<=$contentParts;$i++) 
			{
				$att[$i-2] = imap_bodystruct($this->mbox,$msgno,$i);
				// these extra bits help us later...
				$att[$i-2]->x_msg_id = $msgno;
				$att[$i-2]->x_part_id = $i;
			}
			
			for ($k=0;$k<sizeof($att);$k++) 
			{
				if ( strtolower($att[$k]->parameters[0]->value) == "us-ascii" && $att[$k]->parameters[1]->value != "") 
				{
					$attachments[$k] = $this->_getPartFromStruct($att[$k],$include_raw_data);
				} 
				elseif ( strtolower($att[$k]->parameters[0]->value) != "iso-8859-1" ) 
				{
					$attachments[$k] = $this->_getPartFromStruct($att[$k],$include_raw_data);
				}
			}
		}
		
		return $attachments;
	}
function GetAttachments ( $ msgno , $ include_raw_data = true ) { $ struct = imap_fetchstructure ( $ this -> mbox , $ msgno ) ; $ contentParts = count ( $ struct -> parts ) ; $ attachments = array ( ) ; if ( $ contentParts >= 2 ) { for ( $ i = 2 ; $ i <= $ contentParts ; $ i ++ ) { $ att [ $ i - 2 ] = imap_bodystruct ( $ this -> mbox , $ msgno , $ i ) ; // these extra bits help us later...
 $ att [ $ i - 2 ] -> x_msg_id = $ msgno ; $ att [ $ i - 2 ] -> x_part_id = $ i ; } for ( $ k = 0 ; $ k < sizeof ( $ att ) ; $ k ++ ) { if ( strtolower ( $ att [ $ k ] -> parameters [ 0 ] -> value ) == "us-ascii" && $ att [ $ k ] -> parameters [ 1 ] -> value != "" ) { $ attachments [ $ k ] = $ this -> _getPartFromStruct ( $ att [ $ k ] , $ include_raw_data ) ; } elseif ( strtolower ( $ att [ $ k ] -> parameters [ 0 ] -> value ) != "iso-8859-1" ) { $ attachments [ $ k ] = $ this -> _getPartFromStruct ( $ att [ $ k ] , $ include_raw_data ) ; } } } return $ attachments ; }
Returns an array containing all files attached to message

@param int $msgno The index of the message to retrieve
@param bool $include_raw_data The raw data is the actual contents of the attachment file.  Setting this to FALSE will allow you to display the name, size, type, etc of all attachments without actually downloading the contents of the files.  Use GetAttachmentRawData to retrieve the raw data for an individual attachment.
@return array An array of attachments
Returns an array containing all files attached to message