php mailing using template
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/7220830/problem-when-loading-php-file-into-variable-load-result-of-php-code-instead-of">Problem when loading php file into variable (Load result of php code instead of the code as a string)</a>  </p>
</blockquote>



<p>I am bit confused about following...</p>

<p><strong>message alert function</strong></p>

<pre><code>public static function MsgAlert($email, $name, $subject, $message)
{
    $msg = include('mailer.php');

    $subject = 'New Message';

    if ($email != '' &amp;&amp; validate_email($email))
    {
        $mailer = new PHPMailer();

        $mailer-&gt;SetFrom(ADMIN_EMAIL, SITE_NAME);
        $mailer-&gt;AddAddress($email);
        $mailer-&gt;Subject = $subject;
        $mailer-&gt;Body = Postman::nl2br($msg);
        $mailer-&gt;AltBody = $msg;
        $mailer-&gt;Send();
    }
}
</code></pre>

<p>I have put my newsletter design into mailer.php, and please check markup for that...</p>

<p><strong>mailer.php</strong></p>

<pre><code>&lt;div&gt;
&lt;h1&gt;&lt;?php $subject; ?&gt;&lt;span&gt;27 September 2011 at 6:26 pm&lt;/span&gt;&lt;/h1&gt;
&lt;div&gt;
&lt;p&gt;Hello &lt;?php $name; ?&gt;,&lt;/p&gt;
&lt;?php $message; ?&gt;
&lt;/div&gt; &lt;!--message container --&gt;
&lt;/div&gt;
</code></pre>

<p>Am i using correct approach or should i do something more better as its not working. please suggest. thanks.</p>
