Take the 2-minute tour ×  How can I send an email using php then
add a template design in the email? I'm using this:  $to =
"someone@example.com";   $subject = "Test mail";   $from =
"someonelse@example.com";   $headers = "From: $from";   echo
"Mail Sent.";    And it works fine! The problem is just how to
add a template.  share|improve this question You should work on
your acceptrate first.. –  Dennis Haarbrink Sep 14 '10 at 7:30
6 Answers 6  Lets have a small crack at this :)  class Emailer
var $recipients = array();     var $EmailTemplate;     var
$EmailContents;      public function __construct($to = false)
if($to !== false)                 foreach($to as $_to){
$this->recipients[$_to] = $_to; }
$this->recipients[$to] = $to; //1 Recip      function
SetTemplate(EmailTemplate $EmailTemplate)
$this->EmailTemplate = $EmailTemplate;          //When you use
the send( ) function you would use $EmailTemplate->compile();
Notice the function SetTemplate() ...  Heres a a small te