コード例 #1
0
ファイル: error.php プロジェクト: nciftci/codefaster
/*
Send error to ADMIN.
High traffic websites have the potential to generate A LOT of 
emails so make sure you setup some sort of email filter for these 
error notifications so they don't flood your inbox. 
*/
$ftea = new FastTemplate(EMAIL_PATH);
$ftea->define(array("main" => "template_index.html", "content" => "error.html"));
$ftea->assign("IP", $ip);
$ftea->assign("SERVER_NAME", $server_name);
$ftea->assign("REQUEST_URI", $request_uri);
$ftea->assign("HTTP_REF", $http_ref);
$ftea->assign("HTTP_AGENT", $http_agent);
$ftea->assign("ERROR_DATE", $error_date);
$ftea->assign("ERROR_CODE", $error_code);
$ftea->multiple_assign_define("CONF_");
$ftea->multiple_assign_define("LANG_");
$ftea->parse("CONTENT", "content");
$ftea->parse("BODY", "main");
$subject = $error_code;
$message = $ftea->fetch("BODY");
$mail = new UniversalMailSender("2");
$mail->setToAddress(EMAIL_INREG, EMAIL_NAME);
$mail->setFromAddress(EMAIL_INREG, EMAIL_NAME);
$mail->setSubject($subject);
$mail->setType(2);
$mail->setHtmlMessage($message);
$mail->SendMail();
$ft->parse("BODY", array("content", "main"));
$ft->showDebugInfo(ERROR_DEBUG);
$ft->FastPrint();
コード例 #2
0
        $password = $row["value"];
    } while ($row = mysql_fetch_array($retid));
}
$to = "";
$subject = "";
$headers = "";
$message = "";
$fte = new FastTemplate(EMAIL_PATH);
$fte->define(array("main" => "emailpasswordrecovery.html"));
$fte->assign("USERID", $username);
$fte->assign("PASSWORD", $password);
$fte->multiple_assign_define("LANG_");
$fte->multiple_assign_define("CONF_");
$fte->parse("mainContent", "main");
$fte->showDebugInfo(ERROR_DEBUG);
$message = $fte->fetch("mainContent");
// se trimite scrisoarea
$univMail = new UniversalMailSender("2");
// setting up the to address
$univMail->setToAddress($email, $username);
// setting up from address
$univMail->setFromAddress($email, $username);
// setting up subject
$univMail->setSubject($all_url_vars['newslettersubject']);
// setting up from text message if the type is text message
$univMail->setTextMessage($message);
// setting up from text message if the type is html message
$univMail->setHtmlMessage($message);
// sending the mail; returns an error message
$ok = $univMail->SendMail();
header("Location: login.php?message=" . LANG_ADMIN_PASSWORD_SENTSUCCESSFULLY);