public function mail($to, $subj, $body, $headers = false, $params = false)
 {
     $mail = new PHPMailer();
     $mail->IsSMTP();
     // set mailer to use SMTP
     $mail->Host = "mail.inversiondesigns.com";
     // specify main and backup server
     $mail->SMTPAuth = true;
     // turn on SMTP authentication
     $mail->Username = "******";
     // SMTP username
     $mail->Password = "******";
     // SMTP password
     $mail->AddAddress($to);
     if (is_string($headers)) {
         $headers = explode("\n", $headers);
         foreach ($headers as $header) {
             $h = explode(":", $header, 2);
             if (stripos($h[0], "From") !== false) {
                 $from = $h[1];
                 if (stripos($from, "<") !== false) {
                     $start = strpos($from, "<") + 1;
                     $mail->From = substr($from, $start, strpos($from, ">") - $start);
                     $mail->FromName = substr($from, 0, strpos($from, "<"));
                 } else {
                     $mail->From = $h[1];
                     $mail->FromName = $h[1];
                 }
             } else {
                 $mail->AddCustomHeader(trim($header));
             }
         }
     } else {
         $mail->From = "*****@*****.**";
         $mail->FromName = "Inversion Bot";
         $mail->AddReplyTo("*****@*****.**", "No Reply");
     }
     //$mail->WordWrap = 50;                                 // set word wrap to 50 characters
     $mail->IsHTML(true);
     // set email format to HTML
     $mail->Subject = $subj;
     $mail->Body = $body;
     $mail->AltBody = strip_tags($body);
     $result = $mail->Send();
     $mail->close();
     return $result;
 }