title: How to Change PHPMailer class to normal Mail
body: <p>I am having problems sending emails using the PHPMailer class for my registration form.  I was wondering if the below code could be changed into a normal Mail class please.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  
  require_once('PHPMailer_v5.1/PHPMailer.php');
  
  class Email {
  
   public $objUrl;
   private $objMailer;
  
   public function __construct($objUrl = null) {
   
    $this-&gt;objUrl = is_object($objUrl) ? $objUrl : new Url();
    
    $this-&gt;objMailer = new PHPMailer();
    $this-&gt;objMailer-&gt;IsSMTP();
    $this-&gt;objMailer-&gt;SMTPAuth = true;
    $this-&gt;objMailer-&gt;SMTPKeepAlive = true;
    $this-&gt;objMailer-&gt;SMTPSecure = 'ssl';
    $this-&gt;objMailer-&gt;Host = "smtp.gmail.com";
    $this-&gt;objMailer-&gt;Port = 465;
    $this-&gt;objMailer-&gt;Username = "email here";
    $this-&gt;objMailer-&gt;Password = "password here";
    $this-&gt;objMailer-&gt;SetFrom("email here", "name here");
    $this-&gt;objMailer-&gt;AddReplyTo("email here ", "name here");
    
    
    
   }
  
   public function process($case = null, $array = null) {
   
    if (!empty($case)) {
    
     switch($case) {
      
      case 1:
      
      // add url to the array
      $link  = "&lt;a href=\"";
      $link .= SITE_URL.$this-&gt;objUrl-&gt;href('activate', array('code', $array['hash']));
      $link .= "\"&gt;";
      $link .= SITE_URL.$this-&gt;objUrl-&gt;href('activate', array('code', $array['hash']));
      $link .= "&lt;/a&gt;";
      $array['link'] = $link;
      
      $this-&gt;objMailer-&gt;Subject = "Activate your account";
      
      $this-&gt;objMailer-&gt;MsgHTML($this-&gt;fetchEmail($case, $array));
      $this-&gt;objMailer-&gt;AddAddress(
       $array['email'], 
       $array['first_name'].' '.$array['last_name']
      );
      
      break;
      
     }
     
     
     // send email
     if ($this-&gt;objMailer-&gt;Send()) {
      $this-&gt;objMailer-&gt;ClearAddresses();
      return true;
     }
     return false;
     
    
    }
   
   
   }
  
   public function fetchEmail($case = null, $array = null) {
   
    if (!empty($case)) {
     
     if (!empty($array)) {   
      foreach($array as $key =&gt; $value) {
       ${$key} = $value;
      }   
     }
     
     ob_start();
     require_once(EMAILS_PATH.DS.$case.".php");
     $out = ob_get_clean();
     return $this-&gt;wrapEmail($out);
    
    }
   
   }
  
   public function wrapEmail($content = null) {
    if (!empty($content)) {
     return "&lt;div style=\"font-family:Arial,Verdana,Sans-serif;font-size:12px;color:#333;line-height:21px;\"&gt;{$content}&lt;/div&gt;";
    }
   }
   
  
  
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Any help is much appreciated</p>
  
  <p>Thanks</p>
  
  <p>I have tried to amend the code to the below code but all I get is a blank screen.  I have checked on firefox and no error messages are displayed.  Can anyone help fix the problem.</p>
  
  <p>Thank you</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  
  //require_once('PHPMailer_v5.1/PHPMailer.php');
  
  class Email {
  
   public $objUrl;
   //private $objMailer;
  
   public function __construct($objUrl = null) {
   
    $this-&gt;objUrl = is_object($objUrl) ? $objUrl : new Url();
    
    $to = "qakbar26@gmail.com";
    $headers = 'MIME-Version: 1.0'."\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
    $headers .= "From: qakbar26@gmail.com";
    
    
    
   }
  
   public function process($case = null, $array = null) {
   
    if (!empty($case)) {
    
     switch($case) {
      
      case 1:
      
      // add url to the array
      $link  = "&lt;a href=\"";
      $link .= SITE_URL.$this-&gt;objUrl-&gt;href('activate', array('code', $array['hash']));
      $link .= "\"&gt;";
      $link .= SITE_URL.$this-&gt;objUrl-&gt;href('activate', array('code', $array['hash']));
      $link .= "&lt;/a&gt;";
      $array['link'] = $link;
      
      $subject = "Activate your account";
      
      $message($this-&gt;fetchEmail($case, $array));
      $address(
       $array['email'], 
       $array['first_name'].' '.$array['last_name']
      );
      
      break;
      
     }
     
     
     // send email
     if ($send()) {
      $this-&gt;ClearAddresses();
      return true;
     }
     return false;
     
    
    }
   
   
   }
  
   public function fetchEmail($case = null, $array = null) {
   
    if (!empty($case)) {
     
     if (!empty($array)) {   
      foreach($array as $key =&gt; $value) {
       ${$key} = $value;
      }   
     }
     
     ob_start();
     require_once(EMAILS_PATH.DS.$case.".php");
     $out = ob_get_clean();
     return $this-&gt;wrapEmail($out);
    
    }
   
   }
  
   public function wrapEmail($content = null) {
    if (!empty($content)) {
     return "&lt;div style=\"font-family:Arial,Verdana,Sans-serif;font-size:12px;color:#333;line-height:21px;\"&gt;{$content}&lt;/div&gt;";
    }
   }
   
  
  
  
  }</code></pre>
  </div>
  </div>
  </p>