Smarty(); $this->template_dir = fw_gui_base; $this->compile_dir = fw_temp_dir . "/gui"; if (defined("fw_gui_look") ) { $this->config_dir = $this->template_dir . "/" . fw_gui_look . "/configs"; $this->debug_tpl = "file:" . fw_gui_look . "/debug.tpl"; $this->assign("template_root", fw_gui_look); } else { $this->config_dir = $this->template_dir . "/configs"; $this->assign("template_root", fw_gui_base); } global $strings; $this->assign("strings", $strings); } function send($from, $to, $cc, $subject, $inTemplateName, $inType = "text") { $body = $this->fetch(fw_gui_messages . "/" . $inTemplateName); //if(talent_status != "dev") { if($inType) { //echo("here"); message::sendTextEmail($from, $to, $cc, $subject, $body); } else { //echo("here"); message::sendHTMLEmail($from, $to, $cc, $subject, $body); } } } // this is mostly just for debugging function display($from, $to, $cc, $subject, $inTemplateName, $inType = "text") { gui::display(fw_gui_messages . "/" . $inTemplateName); } function sendEmail($from, $to, $cc, $subject, $body, $type = "text") { if(app_status == "dev") { $to = 'john@supernerd.com'; if( $cc != NULL) $cc = 'john@supernerd.com'; } $crlf = "\r\n"; $hdrs = array( 'From' => $from, 'Subject' => $subject, 'To' => $to ); if (!empty($cc)) { $hdrs["Cc"] = $cc; } require_once 'Mail/mime.php'; $mime = new Mail_mime($crlf); if ($type == "text") { $mime->setTXTBody($body); } else { $mime->setHTMLBody($body); } $body = $mime->get(); $hdrs = $mime->headers($hdrs); if(mail_type == "smtp") { if(mail_smtp_auth_use) { //die("Before mail"); $mail =& Mail::factory('smtp', array( "host" => mail_smtp_host, "port" => mail_smtp_port, "auth" => true, "username" => mail_smtp_auth_username, "password" => mail_smtp_auth_password)); } else { $mail =& Mail::factory('smtp', array( "host" => mail_smtp_host, "port" => mail_smtp_port, "auth" => false)); } } else { $mail =& Mail::factory("sendmail"); } $tmp = $mail->send($to, $hdrs, $body); } function sendTextEmail($from, $to, $cc, $subject, $body) { message::sendEmail($from, $to, $cc, $subject, $body, "text"); } function sendHTMLEmail($from, $to, $cc, $subject, $body) { message::sendEmail($from, $to, $cc, $subject, $body, "html"); } } ?>