Location: PHPKode > projects > PHP on Trax > johnpipi-trax-f599562/trax/doc/__filesource/fsource_PHPonTrax__vendortraxaction_mailer.php.html
<html>
<head>
<title>File Source for action_mailer.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">PHPonTrax</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
  		  [ <a href="../classtrees_PHPonTrax.html" class="menu">class tree: PHPonTrax</a> ]
		  [ <a href="../elementindex_PHPonTrax.html" class="menu">index: PHPonTrax</a> ]
		  [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
      <b>Packages:</b><br />
              <a href="../li_PHPonTrax.html">PHPonTrax</a><br />
              <a href="../li_PHPonTraxTest.html">PHPonTraxTest</a><br />
            <br /><br />
                  
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file action_mailer.php</h1>
<p>Documentation is available at <a href="../PHPonTrax/_vendor_trax_action_mailer_php.html">action_mailer.php</a></p>
<div class="php">
<div class="listing"><pre><ol><li><a name="a1"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a2"></a><span class="src-doc">/**</span></li>
<li><a name="a3"></a><span class="src-doc"> *  File for ActionMailer class</span></li>
<li><a name="a4"></a><span class="src-doc"> *</span></li>
<li><a name="a5"></a><span class="src-doc"> *  (PHP 5)</span></li>
<li><a name="a6"></a><span class="src-doc"> *</span></li>
<li><a name="a7"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@package</span><span class="src-doc"> PHPonTrax</span></li>
<li><a name="a8"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@version</span><span class="src-doc"> $Id: action_mailer.php 162 2006-03-06 07:32:02Z john $</span></li>
<li><a name="a9"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@copyright</span><span class="src-doc"> (c) 2005 John Peterson</span></li>
<li><a name="a10"></a><span class="src-doc"> *</span></li>
<li><a name="a11"></a><span class="src-doc"> *   Permission is hereby granted, free of charge, to any person obtaining</span></li>
<li><a name="a12"></a><span class="src-doc"> *   a copy of this software and associated documentation files (the</span></li>
<li><a name="a13"></a><span class="src-doc"> *   &quot;Software&quot;), to deal in the Software without restriction, including</span></li>
<li><a name="a14"></a><span class="src-doc"> *   without limitation the rights to use, copy, modify, merge, publish,</span></li>
<li><a name="a15"></a><span class="src-doc"> *   distribute, sublicense, and/or sell copies of the Software, and to</span></li>
<li><a name="a16"></a><span class="src-doc"> *   permit persons to whom the Software is furnished to do so, subject to</span></li>
<li><a name="a17"></a><span class="src-doc"> *   the following conditions:</span></li>
<li><a name="a18"></a><span class="src-doc"> *</span></li>
<li><a name="a19"></a><span class="src-doc"> *   The above copyright notice and this permission notice shall be</span></li>
<li><a name="a20"></a><span class="src-doc"> *   included in all copies or substantial portions of the Software.</span></li>
<li><a name="a21"></a><span class="src-doc"> *</span></li>
<li><a name="a22"></a><span class="src-doc"> *   THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span></li>
<li><a name="a23"></a><span class="src-doc"> *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span></li>
<li><a name="a24"></a><span class="src-doc"> *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span></li>
<li><a name="a25"></a><span class="src-doc"> *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE</span></li>
<li><a name="a26"></a><span class="src-doc"> *   LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION</span></li>
<li><a name="a27"></a><span class="src-doc"> *   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</span></li>
<li><a name="a28"></a><span class="src-doc"> *   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span></li>
<li><a name="a29"></a><span class="src-doc"> */</span></li>
<li><a name="a30"></a>&nbsp;</li>
<li><a name="a31"></a><span class="src-doc">/**</span></li>
<li><a name="a32"></a><span class="src-doc"> *</span></li>
<li><a name="a33"></a><span class="src-doc"> */</span></li>
<li><a name="a34"></a><span class="src-inc">include_once</span><span class="src-sym">( </span><span class="src-str">&quot;Mail.php&quot; </span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a35"></a><span class="src-inc">include_once</span><span class="src-sym">( </span><span class="src-str">&quot;Mail/mime.php&quot; </span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a36"></a>&nbsp;</li>
<li><a name="a37"></a><span class="src-doc">/**</span></li>
<li><a name="a38"></a><span class="src-doc"> *</span></li>
<li><a name="a39"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@package</span><span class="src-doc"> PHPonTrax</span></li>
<li><a name="a40"></a><span class="src-doc"> */</span></li>
<li><a name="a41"></a><span class="src-key">class </span><a href="../PHPonTrax/ActionMailer.html">ActionMailer</a> <span class="src-sym">{</span></li>
<li><a name="a42"></a>&nbsp;</li>
<li><a name="a43"></a>    </li>
<li><a name="a43"></a><span class="src-key">private</span></li>
<li><a name="a44"></a>        <a href="../PHPonTrax/ActionMailer.html#var$mail_mime">$mail_mime</a><span class="src-sym">,  </span><span class="src-comm">// Mail_mime object</span></li>
<li><a name="a45"></a>                <a href="../PHPonTrax/ActionMailer.html#var$to_addresses">$to_addresses</a><span class="src-sym">,</span></li>
<li><a name="a46"></a>        <a href="../PHPonTrax/ActionMailer.html#var$cc_addresses">$cc_addresses</a><span class="src-sym">,</span></li>
<li><a name="a47"></a>        <a href="../PHPonTrax/ActionMailer.html#var$bcc_addresses">$bcc_addresses</a><span class="src-sym">,</span></li>
<li><a name="a48"></a>        <a href="../PHPonTrax/ActionMailer.html#var$replyto_addresses">$replyto_addresses</a><span class="src-sym">;</span></li>
<li><a name="a49"></a>    </li>
<li><a name="a49"></a><span class="src-key">public</span></li>
<li><a name="a50"></a>        <a href="../PHPonTrax/ActionMailer.html#var$crlf">$crlf</a> = <span class="src-str">&quot;\r\n&quot;</span><span class="src-sym">,</span></li>
<li><a name="a51"></a>        <a href="../PHPonTrax/ActionMailer.html#var$smtp_params">$smtp_params</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">&quot;host&quot;</span>=&gt;<span class="src-str">&quot;localhost&quot;</span><span class="src-sym">, </span><span class="src-str">&quot;port&quot;</span>=&gt;<span class="src-str">&quot;25&quot;</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a52"></a>        <a href="../PHPonTrax/ActionMailer.html#var$send_type">$send_type</a> = <span class="src-str">&quot;mail&quot;</span><span class="src-sym">, </span><span class="src-comm">// smtp or mail</span></li>
<li><a name="a53"></a>                <a href="../PHPonTrax/ActionMailer.html#var$subject">$subject</a> = <span class="src-id">null</span><span class="src-sym">, </span><span class="src-comm">// email subject</span></li>
<li><a name="a54"></a>                <a href="../PHPonTrax/ActionMailer.html#var$from_address">$from_address</a> = <span class="src-str">&quot;no-hide@address.com&quot;</span><span class="src-sym">,</span></li>
<li><a name="a55"></a>        <a href="../PHPonTrax/ActionMailer.html#var$from_name">$from_name</a> = <span class="src-id">null</span><span class="src-sym">,</span></li>
<li><a name="a56"></a>        <a href="../PHPonTrax/ActionMailer.html#var$error">$error</a> = <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a57"></a>&nbsp;</li>
<li><a name="a58"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-var">$crlf </span>= <span class="src-id">null</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a59"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$crlf</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a60"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$crlf">crlf</a> = <span class="src-var">$crlf</span><span class="src-sym">;</span></li>
<li><a name="a61"></a>        <span class="src-sym">}</span></li>
<li><a name="a62"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$mail_mime">mail_mime</a> = <span class="src-key">new </span><span class="src-id">Mail_mime</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a63"></a>    <span class="src-sym">}</span></li>
<li><a name="a64"></a>&nbsp;</li>
<li><a name="a65"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodadd_to_address">add_to_address</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">, </span><span class="src-var">$name </span>= <span class="src-id">null</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a66"></a>        <span class="src-var">$cur </span>= <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$to_addresses">to_addresses</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a67"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$to_addresses">to_addresses</a><span class="src-sym">[</span><span class="src-var">$cur</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">] </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a68"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$to_addresses">to_addresses</a><span class="src-sym">[</span><span class="src-var">$cur</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">] </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a69"></a>    <span class="src-sym">}</span></li>
<li><a name="a70"></a>&nbsp;</li>
<li><a name="a71"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodadd_cc_address">add_cc_address</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">, </span><span class="src-var">$name </span>= <span class="src-id">null</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a72"></a>        <span class="src-var">$cur </span>= <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">cc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a73"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$cc_addresses">cc_addresses</a><span class="src-sym">[</span><span class="src-var">$cur</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">] </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a74"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$cc_addresses">cc_addresses</a><span class="src-sym">[</span><span class="src-var">$cur</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">] </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a75"></a>    <span class="src-sym">}</span></li>
<li><a name="a76"></a>&nbsp;</li>
<li><a name="a77"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodadd_bcc_address">add_bcc_address</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">, </span><span class="src-var">$name </span>= <span class="src-id">null</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a78"></a>        <span class="src-var">$cur </span>= <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">bcc</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a79"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$bcc_addresses">bcc_addresses</a><span class="src-sym">[</span><span class="src-var">$cur</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">] </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a80"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$bcc_addresses">bcc_addresses</a><span class="src-sym">[</span><span class="src-var">$cur</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">] </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a81"></a>    <span class="src-sym">}</span></li>
<li><a name="a82"></a>&nbsp;</li>
<li><a name="a83"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodadd_replyto_address">add_replyto_address</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">, </span><span class="src-var">$name </span>= <span class="src-id">null</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a84"></a>        <span class="src-var">$cur </span>= <a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">ReplyTo</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a85"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$replyto_addresses">replyto_addresses</a><span class="src-sym">[</span><span class="src-var">$cur</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">] </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a86"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$replyto_addresses">replyto_addresses</a><span class="src-sym">[</span><span class="src-var">$cur</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">] </span>= <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a87"></a>    <span class="src-sym">}</span></li>
<li><a name="a88"></a>&nbsp;</li>
<li><a name="a89"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodset_from_address">set_from_address</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">, </span><span class="src-var">$name </span>= <span class="src-id">null</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a90"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$from_address">from_address</a> = <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a91"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">))</span></li>
<li><a name="a92"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$from_name">from_name</a> = <a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a93"></a>    <span class="src-sym">}</span></li>
<li><a name="a94"></a>&nbsp;</li>
<li><a name="a95"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodset_text_body">set_text_body</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a96"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">)</span></li>
<li><a name="a97"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$mail_mime">mail_mime</a><span class="src-sym">-&gt;</span><span class="src-id">setTxtBody</span><span class="src-sym">(</span><span class="src-var">$text</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a98"></a>    <span class="src-sym">}</span></li>
<li><a name="a99"></a>&nbsp;</li>
<li><a name="a100"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodset_html_body">set_html_body</a><span class="src-sym">(</span><span class="src-var">$html</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a101"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$html</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">)</span></li>
<li><a name="a102"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$mail_mime">mail_mime</a><span class="src-sym">-&gt;</span><span class="src-id">setHTMLBody</span><span class="src-sym">(</span><span class="src-var">$html</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a103"></a>    <span class="src-sym">}</span></li>
<li><a name="a104"></a>    </li>
<li><a name="a105"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodset_subject">set_subject</a><span class="src-sym">(</span><span class="src-var">$subject</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a106"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$subject">subject</a> = <span class="src-var">$subject</span><span class="src-sym">;    </span></li>
<li><a name="a107"></a>    <span class="src-sym">}</span></li>
<li><a name="a108"></a>&nbsp;</li>
<li><a name="a109"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodadd_attachment">add_attachment</a><span class="src-sym">(</span><span class="src-var">$file</span><span class="src-sym">, </span><span class="src-var">$content_type </span>=<span class="src-str">'application/octet-stream'</span><span class="src-sym">, </span><span class="src-var">$file_name </span>= <span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$is_file </span>= <span class="src-id">true</span><span class="src-sym">, </span><span class="src-var">$encoding </span>= <span class="src-str">'base64'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a110"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$mail_mime">mail_mime</a><span class="src-sym">-&gt;</span><span class="src-id">addAttachment</span><span class="src-sym">(</span><span class="src-var">$file</span><span class="src-sym">, </span><span class="src-var">$content_type</span><span class="src-sym">, </span><span class="src-var">$file_name</span><span class="src-sym">, </span><span class="src-var">$is_file</span><span class="src-sym">, </span><span class="src-var">$encoding</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a111"></a>    <span class="src-sym">}</span></li>
<li><a name="a112"></a>&nbsp;</li>
<li><a name="a113"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodformat_address">format_address</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a114"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">))</span></li>
<li><a name="a115"></a>            <span class="src-var">$formatted </span>= <span class="src-var">$address</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a116"></a>        <span class="src-key">else</span></li>
<li><a name="a117"></a>            <span class="src-var">$formatted </span>= <a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-str">'&quot;%s&quot; &lt;%s&gt;'</span><span class="src-sym">, </span><span class="src-var">$address</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-var">$address</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a118"></a>&nbsp;</li>
<li><a name="a119"></a>        <span class="src-comm">// now validate if the email address</span></li>
<li><a name="a120"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodvalidate_email">validate_email</a><span class="src-sym">(</span><span class="src-var">$address</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a121"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$error">error</a> .= <span class="src-str">&quot;Invalid email address: &quot;</span>.<span class="src-var">$address</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>.<span class="src-str">&quot;&lt;br&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a122"></a>        <span class="src-sym">}</span></li>
<li><a name="a123"></a>&nbsp;</li>
<li><a name="a124"></a>        <span class="src-key">return </span><span class="src-var">$formatted</span><span class="src-sym">;</span></li>
<li><a name="a125"></a>    <span class="src-sym">}</span></li>
<li><a name="a126"></a>&nbsp;</li>
<li><a name="a127"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodvalidate_email">validate_email</a><span class="src-sym">(</span><span class="src-var">$email</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a128"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/eregi">eregi</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">^<span class="src-sym">[</span><span class="src-id">a</span>-<span class="src-id">zA</span>-<span class="src-id">Z0</span>-9.<span class="src-id">_</span>-<span class="src-sym">]</span>+@(<span class="src-sym">[</span><span class="src-id">a</span>-<span class="src-id">zA</span>-<span class="src-id">Z0</span>-9.<span class="src-id">_</span>-<span class="src-sym">]</span>+\.)+(<span class="src-sym">[</span><span class="src-id">a</span>-<span class="src-id">zA</span>-<span class="src-id">Z0</span>-9<span class="src-id">_</span>-<span class="src-sym">]</span>)<span class="src-sym">{</span>2,4<span class="src-sym">}</span>$</span><span class="src-str">&quot;</span><span class="src-sym">, </span><span class="src-var">$email</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a129"></a>            <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a130"></a>        <span class="src-sym">}</span></li>
<li><a name="a131"></a>        <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a132"></a>    <span class="src-sym">}</span></li>
<li><a name="a133"></a>&nbsp;</li>
<li><a name="a134"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-var">$header_key</span><span class="src-sym">, </span><span class="src-var">$header_value</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a135"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$header_key </span>&amp;&amp; <span class="src-var">$header_value</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a136"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">headers</span><span class="src-sym">[</span><span class="src-var">$header_key</span><span class="src-sym">] </span>= <span class="src-var">$header_value</span><span class="src-sym">;</span></li>
<li><a name="a137"></a>        <span class="src-sym">}</span></li>
<li><a name="a138"></a>    <span class="src-sym">}</span></li>
<li><a name="a139"></a>&nbsp;</li>
<li><a name="a140"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodset_headers">set_headers</a><span class="src-sym">(</span><span class="src-var">$extra_headers </span>= <span class="src-id">null</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a141"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$to_addresses">to_addresses</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a142"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$to_addresses">to_addresses</a> <span class="src-key">as </span><span class="src-var">$to_address</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a143"></a>                <span class="src-var">$to_addresses</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodformat_address">format_address</a><span class="src-sym">(</span><span class="src-var">$to_address</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a144"></a>            <span class="src-sym">}</span></li>
<li><a name="a145"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$to_addresses</span><span class="src-sym">)) </span><span class="src-var">$to_addresses </span>= <a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">&quot;,&quot;</span><span class="src-sym">, </span><span class="src-var">$to_addresses</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a146"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$to_addresses</span><span class="src-sym">))</span></li>
<li><a name="a147"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-str">&quot;To&quot;</span><span class="src-sym">, </span><span class="src-var">$to_addresses</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a148"></a>        <span class="src-sym">}</span></li>
<li><a name="a149"></a>&nbsp;</li>
<li><a name="a150"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$cc_addresses">cc_addresses</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a151"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$cc_addresses">cc_addresses</a> <span class="src-key">as </span><span class="src-var">$cc_address</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a152"></a>                <span class="src-var">$cc_addresses</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodformat_address">format_address</a><span class="src-sym">(</span><span class="src-var">$cc_address</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a153"></a>            <span class="src-sym">}</span></li>
<li><a name="a154"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$cc_addresses</span><span class="src-sym">)) </span><span class="src-var">$cc_addresses </span>= <a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">&quot;,&quot;</span><span class="src-sym">, </span><span class="src-var">$cc_addresses</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a155"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$cc_addresses</span><span class="src-sym">))</span></li>
<li><a name="a156"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-str">&quot;Cc&quot;</span><span class="src-sym">, </span><span class="src-var">$cc_addresses</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a157"></a>        <span class="src-sym">}</span></li>
<li><a name="a158"></a>&nbsp;</li>
<li><a name="a159"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$bcc_addresses">bcc_addresses</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a160"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$bcc_addresses">bcc_addresses</a> <span class="src-key">as </span><span class="src-var">$bcc_address</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a161"></a>                <span class="src-var">$bcc_addresses</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodformat_address">format_address</a><span class="src-sym">(</span><span class="src-var">$bcc_address</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a162"></a>            <span class="src-sym">}</span></li>
<li><a name="a163"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$bcc_addresses</span><span class="src-sym">)) </span><span class="src-var">$bcc_addresses </span>= <a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">&quot;,&quot;</span><span class="src-sym">, </span><span class="src-var">$bcc_addresses</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a164"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$bcc_addresses</span><span class="src-sym">))</span></li>
<li><a name="a165"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-str">&quot;Bcc&quot;</span><span class="src-sym">, </span><span class="src-var">$bcc_addresses</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a166"></a>        <span class="src-sym">}</span></li>
<li><a name="a167"></a>&nbsp;</li>
<li><a name="a168"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$replyto_addresses">replyto_addresses</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a169"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$replyto_addresses">replyto_addresses</a> <span class="src-key">as </span><span class="src-var">$replyto_address</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a170"></a>                <span class="src-var">$replyto_addresses</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodformat_address">format_address</a><span class="src-sym">(</span><span class="src-var">$replyto_address</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a171"></a>            <span class="src-sym">}</span></li>
<li><a name="a172"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$replyto_addresses</span><span class="src-sym">)) </span><span class="src-var">$replyto_addresses </span>= <a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">&quot;,&quot;</span><span class="src-sym">, </span><span class="src-var">$replyto_addresses</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a173"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$replyto_addresses</span><span class="src-sym">))</span></li>
<li><a name="a174"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-str">&quot;Reply-To&quot;</span><span class="src-sym">, </span><span class="src-var">$replyto_addresses</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a175"></a>        <span class="src-sym">}</span></li>
<li><a name="a176"></a>&nbsp;</li>
<li><a name="a177"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$subject">subject</a><span class="src-sym">))  </span><span class="src-sym">{</span></li>
<li><a name="a178"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-str">&quot;Subject&quot;</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$subject">subject</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a179"></a>        <span class="src-sym">}  </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a180"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-str">&quot;Subject&quot;</span><span class="src-sym">, </span><span class="src-str">&quot;&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a181"></a>        <span class="src-sym">}</span></li>
<li><a name="a182"></a>&nbsp;</li>
<li><a name="a183"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$from_address">from_address</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a184"></a>            <span class="src-var">$from_address </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodformat_address">format_address</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">&quot;0&quot;</span>=&gt;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$from_address">from_address</a><span class="src-sym">, </span><span class="src-str">&quot;1&quot;</span>=&gt;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$from_name">from_name</a><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a185"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-str">&quot;From&quot;</span><span class="src-sym">, </span><span class="src-var">$from_address</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a186"></a>        <span class="src-sym">}</span></li>
<li><a name="a187"></a>&nbsp;</li>
<li><a name="a188"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$extra_headers</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a189"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$extra_headers </span><span class="src-key">as </span><span class="src-var">$extra_key </span>=&gt; <span class="src-var">$extra_value</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a190"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$extra_key</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$extra_value</span><span class="src-sym">))</span></li>
<li><a name="a191"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-var">$extra_key</span><span class="src-sym">, </span><span class="src-var">$extra_value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a192"></a>            <span class="src-sym">}</span></li>
<li><a name="a193"></a>        <span class="src-sym">}</span></li>
<li><a name="a194"></a>&nbsp;</li>
<li><a name="a195"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">&quot;Date&quot;</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">headers</span><span class="src-sym">))</span></li>
<li><a name="a196"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-str">&quot;Date&quot;</span><span class="src-sym">, </span><a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">&quot;r&quot;</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a197"></a>        </li>
<li><a name="a198"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">&quot;Return-Path&quot;</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">headers</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$from_address">from_address</a><span class="src-sym">))</span></li>
<li><a name="a199"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-str">&quot;Return-Path&quot;</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$from_address">from_address</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a200"></a>            </li>
<li><a name="a201"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">&quot;Reply-To&quot;</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">headers</span><span class="src-sym">) </span>&amp;&amp; <span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$from_address">from_address</a><span class="src-sym">))</span></li>
<li><a name="a202"></a>            <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_header_line">set_header_line</a><span class="src-sym">(</span><span class="src-str">&quot;Reply-To&quot;</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$from_address">from_address</a><span class="src-sym">)</span><span class="src-sym">;            </span></li>
<li><a name="a203"></a>    <span class="src-sym">}</span></li>
<li><a name="a204"></a>&nbsp;</li>
<li><a name="a205"></a>    <span class="src-key">function </span><a href="../PHPonTrax/ActionMailer.html#methodsend">send</a><span class="src-sym">(</span><span class="src-var">$to_address </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$subject </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$text_body </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$html_body </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$extra_headers </span>= <span class="src-id">null</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a206"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$to_address</span><span class="src-sym">)) </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodadd_to_address">add_to_address</a><span class="src-sym">(</span><span class="src-var">$to_address</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a207"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$subject</span><span class="src-sym">)) </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_subject">set_subject</a><span class="src-sym">(</span><span class="src-var">$subject</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a208"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$html_body</span><span class="src-sym">)) </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_html_body">set_html_body</a><span class="src-sym">(</span><span class="src-var">$html_body</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a209"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$text_body</span><span class="src-sym">)) </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_text_body">set_text_body</a><span class="src-sym">(</span><span class="src-var">$text_body</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a210"></a>&nbsp;</li>
<li><a name="a211"></a>        <span class="src-var">$body </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$mail_mime">mail_mime</a><span class="src-sym">-&gt;</span><span class="src-id">get</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a212"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#methodset_headers">set_headers</a><span class="src-sym">(</span><span class="src-var">$extra_headers</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a213"></a>        <span class="src-var">$headers </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$mail_mime">mail_mime</a><span class="src-sym">-&gt;</span><span class="src-id">headers</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">headers</span><span class="src-sym">)</span><span class="src-sym">;       </span></li>
<li><a name="a214"></a>&nbsp;</li>
<li><a name="a215"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$send_type">send_type</a> == <span class="src-str">&quot;smtp&quot;</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a216"></a>            <span class="src-var">$mail </span>=<span class="src-sym">&amp; </span><span class="src-id">Mail</span><span class="src-sym">::</span><span class="src-id">factory</span><span class="src-sym">(</span><span class="src-str">&quot;smtp&quot;</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$smtp_params">smtp_params</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a217"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a218"></a>            <span class="src-var">$mail </span>=<span class="src-sym">&amp; </span><span class="src-id">Mail</span><span class="src-sym">::</span><span class="src-id">factory</span><span class="src-sym">(</span><span class="src-str">&quot;mail&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a219"></a>        <span class="src-sym">}</span></li>
<li><a name="a220"></a>&nbsp;</li>
<li><a name="a221"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$error">error</a><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a222"></a>            <span class="src-var">$result </span>= <span class="src-var">$mail</span><span class="src-sym">-&gt;</span><span class="src-id">send</span><span class="src-sym">(</span><span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$headers</span><span class="src-sym">, </span><span class="src-var">$body</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a223"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a224"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/ActionMailer.html#var$error">error</a> = <span class="src-var">$result</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a225"></a>                <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a226"></a>            <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a227"></a>                <span class="src-key">return </span><span class="src-id">true</span><span class="src-sym">;</span></li>
<li><a name="a228"></a>            <span class="src-sym">}</span></li>
<li><a name="a229"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a230"></a>            <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a231"></a>        <span class="src-sym">}</span></li>
<li><a name="a232"></a>    <span class="src-sym">}</span></li>
<li><a name="a233"></a>&nbsp;</li>
<li><a name="a234"></a><span class="src-sym">}</span></li>
<li><a name="a235"></a>&nbsp;</li>
<li><a name="a236"></a>&nbsp;</li>
<li><a name="a237"></a><span class="src-php">?&gt;</span></li>
</ol></pre></div>
</div>
        <div class="credit">
		    <hr />
		    Documentation generated on Thu, 04 May 2006 19:47:03 -0600 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC4</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>
Return current item: PHP on Trax