Location: PHPKode > scripts > Email Parser > Documentation/Parser/Parser.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Parser</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Parser</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Class for parsing raw emails</p>
<p class="description"><p>This class is used to parse raw emails into  logical easy to use parts.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Joshua Gilman</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_parser_class_php.html">/parser.class.php</a> (line <span class="field"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a12">12</a></span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
								<div class="var-title">
					<span class="var-type">String</span>
					<a href="#$boundary" title="details" class="var-name">$boundary</a>
				</div>
								<div class="var-title">
					<span class="var-type">String</span>
					<a href="#$content" title="details" class="var-name">$content</a>
				</div>
								<div class="var-title">
					<span class="var-type">Mixed</span>
					<a href="#$files" title="details" class="var-name">$files</a>
				</div>
								<div class="var-title">
					<span class="var-type">String</span>
					<a href="#$from" title="details" class="var-name">$from</a>
				</div>
								<div class="var-title">
					<span class="var-type">String</span>
					<a href="#$header" title="details" class="var-name">$header</a>
				</div>
								<div class="var-title">
					<span class="var-type">Mixed</span>
					<a href="#$message" title="details" class="var-name">$message</a>
				</div>
								<div class="var-title">
					<span class="var-type">String</span>
					<a href="#$P_NEWLINE" title="details" class="var-name">$P_NEWLINE</a>
				</div>
								<div class="var-title">
					<span class="var-type">String</span>
					<a href="#$subject" title="details" class="var-name">$subject</a>
				</div>
								<div class="var-title">
					<span class="var-type">String</span>
					<a href="#$to" title="details" class="var-name">$to</a>
				</div>
							</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											(<span class="var-type">String</span>&nbsp;<span class="var-name">$mail</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#load_contents" title="details" class="method-name">load_contents</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#load_files" title="details" class="method-name">load_files</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#load_message" title="details" class="method-name">load_message</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#load_parts" title="details" class="method-name">load_parts</a>
											(<span class="var-type">String</span>&nbsp;<span class="var-name">$content</span>)
									</div>
							</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$boundary" id="$boundary"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">String</span>
			<span class="var-name">$boundary</span>
			 = <span class="var-default"> NULL</span>			(line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a34">34</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Contains the boundary used to parse the raw email</p>
	
	
		
		

</div>
<a name="var$content" id="$content"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">String</span>
			<span class="var-name">$content</span>
			 = <span class="var-default"> NULL</span>			(line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a41">41</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Contains everything below the header of the raw email</p>
	
	
		
		

</div>
<a name="var$files" id="$files"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">Mixed</span>
			<span class="var-name">$files</span>
			 = <span class="var-default">array()</span>			(line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a84">84</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Contains all the parsed attachments in the raw email</p>
	
	
		
		

</div>
<a name="var$from" id="$from"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">String</span>
			<span class="var-name">$from</span>
			 = <span class="var-default"> NULL</span>			(line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a56">56</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Contains who the email is from</p>
	
	
		
		

</div>
<a name="var$header" id="$header"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">String</span>
			<span class="var-name">$header</span>
			 = <span class="var-default"> NULL</span>			(line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a27">27</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Contains the raw header of the email</p>
	
	
		
		

</div>
<a name="var$message" id="$message"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">Mixed</span>
			<span class="var-name">$message</span>
			 = <span class="var-default">array()</span>			(line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a76">76</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Contains all the types of messages sent</p>
	
	
		
		

</div>
<a name="var$P_NEWLINE" id="$P_NEWLINE"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">String</span>
			<span class="var-name">$P_NEWLINE</span>
			 = <span class="var-default"> &quot;\r\n&quot;</span>			(line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a19">19</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Determines how a newline is parsed</p>
	
	
		
		

</div>
<a name="var$subject" id="$subject"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">String</span>
			<span class="var-name">$subject</span>
			 = <span class="var-default"> NULL</span>			(line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a63">63</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Contains the subject of the email</p>
	
	
		
		

</div>
<a name="var$to" id="$to"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">String</span>
			<span class="var-name">$to</span>
			 = <span class="var-default"> NULL</span>			(line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a49">49</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Contains who the email is addressed to</p>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a96">96</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The constructor of the class</p>
<p class="description"><p>This function loads and parses the raw email given ($mail)  and prepares it for usage</p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			__construct
		</span>
					(<span class="var-type">String</span>&nbsp;<span class="var-name">$mail</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$mail</span>			</li>
				</ul>
		
		
	</div>
<a name="methodload_contents" id="load_contents"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">load_contents</span> (line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a154">154</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Parses the basic content of the email</p>
<p class="description"><p>This function parses the to, from, and subject  from the raw email's header</p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			load_contents
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodload_files" id="load_files"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">load_files</span> (line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a217">217</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Parses any attachments in the raw email</p>
<p class="description"><p>This function parses ALL attachments in  the email into an array of associative arrays  containing the common information of each  file including the name, base name, extension,  and content. The files contents are decoded  when they are parsed.</p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			load_files
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodload_message" id="load_message"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">load_message</span> (line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a186">186</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Parses the message from the email</p>
<p class="description"><p>This function parses the two common formats of  a raw message, plain text, and html formatted.  It loads both (if either one exists) into an  associative array based on their names</p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			load_message
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodload_parts" id="load_parts"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">load_parts</span> (line <span class="line-number"><a href="..//__filesource/fsource_Parser__parser.class.php.html#a120">120</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets up the class for other functions</p>
<p class="description"><p>This function parses the boundary of the raw email  then preceeds to parse the header and content of  the raw email for other functions to use</p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			load_parts
		</span>
					(<span class="var-type">String</span>&nbsp;<span class="var-name">$content</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$content</span>			</li>
				</ul>
		
		
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Sun, 07 Jan 2007 21:19:37 -0800 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</div></body>
</html>
Return current item: Email Parser