本文整理汇总了PHP中htmlMimeMail::setCrlf方法的典型用法代码示例。如果您正苦于以下问题:PHP htmlMimeMail::setCrlf方法的具体用法?PHP htmlMimeMail::setCrlf怎么用?PHP htmlMimeMail::setCrlf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htmlMimeMail
的用法示例。
在下文中一共展示了htmlMimeMail::setCrlf方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: template
function m_sendMail()
{
$libFunc = new c_libFunctions();
$this->ObTpl = new template();
$this->ObTpl->set_file("TPL_VAR_CMS", MODULES_PATH . "default/templates/main/contactmail.tpl.htm");
$this->ObTpl->set_var("TPL_VAR_NAME", $this->libFunc->m_displayContent($this->request['sName']));
$this->ObTpl->set_var("TPL_VAR_ADDRESS1", $this->libFunc->m_displayContent($this->request['sAddress1']));
$this->ObTpl->set_var("TPL_VAR_ADDRESS2", $this->libFunc->m_displayContent($this->request['sAddress2']));
$this->ObTpl->set_var("TPL_VAR_PHONE", $this->libFunc->m_displayContent($this->request['sWorkPhone']));
$this->ObTpl->set_var("TPL_VAR_COUNTRY", $this->libFunc->m_displayContent($this->request['sCountry']));
$this->ObTpl->set_var("TPL_VAR_COMMENTS", nl2br($this->libFunc->m_displayContent($this->request['sComments'])));
$message = "========================================<br />";
$message .= "Contact request from " . SITE_NAME . "<br />";
$message .= "========================================<br />";
$message .= $this->ObTpl->parse("return", "TPL_VAR_CMS");
$this->request['sName'] . "<" . $this->libFunc->m_displayContent1($this->request['sEmail']) . ">";
$obMail = new htmlMimeMail();
$obMail->setReturnPath(ADMIN_EMAIL);
$this->libFunc->m_displayContent($this->request['sName']) . "<" . $this->libFunc->m_displayContent1($this->request['sEmail']) . ">";
$obMail->setFrom($this->libFunc->m_displayContent1("\"" . $this->request['sName'] . "\"") . "<" . $this->libFunc->m_displayContent1($this->request['sEmail']) . ">");
$obMail->setSubject("Contact request from " . SITE_NAME);
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
$htmlcontent = $message;
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $message));
$obMail->setHtml($htmlcontent, $txtcontent);
$obMail->buildMessage();
$result = $obMail->send(array(ENQUIRY_EMAIL));
}
示例2: time
function m_reviewAdd()
{
$this->request['display'] = $this->libFunc->ifSet($this->request, "display");
$timestamp = time();
$this->obDb->query = "SELECT iProdid_PK FROM " . PRODUCTS . " WHERE iProdid_PK='" . $this->request['productid'] . "'";
$rs = $this->obDb->fetchQuery();
if ($this->obDb->record_count > 0) {
#inserting to departments
$this->obDb->query = "SELECT iCustRevid_PK FROM " . REVIEWS . " WHERE iCustomerid_FK='" . $_SESSION['userid'] . "' AND iItemid_FK='" . $this->request['productid'] . "'";
$rs = $this->obDb->fetchQuery();
$rsCnt = $this->obDb->record_count;
if ($rsCnt == 0) {
$this->obDb->query = "INSERT INTO " . REVIEWS . "\n\t\t\t\t\t\t\t\t\t\t(vTitle,vComment,vRank,iDisplay,iItemid_FK,tmDateAdd,iCustomerid_FK,iState) \n\t\t\t\t\t\t\t\t\t\t\tvalues('" . $this->libFunc->m_addToDB($this->request['title']) . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $this->libFunc->m_addToDB($this->request['comment']) . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $this->libFunc->m_addToDB($this->request['rank']) . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $this->request['display'] . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $this->request['productid'] . "',\n\t\t\t\t\t\t\t\t\t\t\t'{$timestamp}','" . $_SESSION['userid'] . "',1)";
$this->obDb->updateQuery();
} else {
$this->obDb->query = "UPDATE " . REVIEWS . " SET vTitle='" . $this->libFunc->m_addToDB($this->request['title']) . "',\n\t\t\t\t\t\t\t\t\t\tvComment='" . $this->libFunc->m_addToDB($this->request['comment']) . "',\n\t\t\t\t\t\t\t\t\t\tvRank='" . $this->libFunc->m_addToDB($this->request['rank']) . "',\n\t\t\t\t\t\t\t\t\t\tiDisplay='" . $this->request['display'] . "',\n\t\t\t\t\t\t\t\t\t\tiItemid_FK='" . $this->request['productid'] . "',\n\t\t\t\t\t\t\t\t\t\ttmDateAdd='{$timestamp}' WHERE iCustRevid_PK='" . $rs[0]->iCustRevid_PK . "'";
$this->obDb->updateQuery();
}
# additional functionality to e-mail admin on new submission of new product review - MCB, 26/09/2008
$this->obDb->query = "SELECT vFirstName, vLastName FROM " . CUSTOMERS . " WHERE iCustmerid_PK=" . $_SESSION['userid'];
$name_row = $this->obDb->fetchQuery();
$customername = $name_row[0]->vFirstName . " " . $name_row[0]->vLastName;
$obMail = new htmlMimeMail();
$obMail->setReturnPath(ADMIN_EMAIL);
$obMail->setFrom(SITE_NAME . "<" . ADMIN_EMAIL . ">");
$obMail->setSubject("New product review");
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
$message = "Somebody has posted a new product review on your on-line store.<br>Details of this review are listed below.<br><br>";
$message .= $customername . " submitted the following at " . date('g:ia') . " on " . date('l, d F Y') . ":<br><br>";
$message .= $this->libFunc->m_displayContent($this->request['comment']) . "<br><br>";
$message .= "To view this comment, please visit the following URL:<br>";
$message .= "<a href=\"" . SITE_URL . "ecom/index.php?action=ecom.pdetails&mode=" . $this->request['mode'] . "\">" . SITE_URL . "ecom/index.php?action=ecom.pdetails&mode=" . $this->request['mode'] . "</a>";
$htmlcontent = $message;
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $message));
$obMail->setHtml($htmlcontent, $txtcontent);
$obMail->buildMessage();
if (preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$/i", ADMIN_EMAIL)) {
$result = $obMail->send(array(ADMIN_EMAIL));
}
}
# redirect on posting and e-mailing of comment ...
$retUrl = $this->libFunc->m_safeUrl(SITE_URL . "ecom/index.php?action=ecom.pdetails&mode=" . $this->request['seotitle']);
$this->libFunc->m_mosRedirect($retUrl);
exit;
}
示例3: template
function m_sendConfirmation()
{
$this->comFunc->obDb = $this->obDb;
$this->obDb->query = "SELECT vFirstName,vLastName,vEmail FROM " . ORDERS . " WHERE iOrderid_PK = '" . $this->request['orderid'] . "'";
$qryResult = $this->obDb->fetchQuery();
$rCount = $this->obDb->record_count;
// $uniqID=uniqid (3);
if ($rCount > 0) {
$name = $this->libFunc->m_displayContent($qryResult[0]->vFirstName) . " " . $this->libFunc->m_displayContent($qryResult[0]->vLastName);
$this->ObTpl = new template();
$this->ObTpl->set_file("TPL_MAIL_FILE", $this->mailTemplate);
$this->ObTpl->set_var("TPL_VAR_NAME", $name);
$this->ObTpl->set_var("TPL_VAR_INVOICE", $this->request['invoice']);
$this->ObTpl->set_var("TPL_VAR_METHOD", $this->request['shipper']);
$this->ObTpl->set_var("TPL_VAR_TRACKNUM", $this->request['tracking']);
$orderUrl = $this->libFunc->m_safeUrl(SITE_URL . "ecom/index.php?action=checkout.receipt&mode=" . $this->request['orderid']);
$this->ObTpl->set_var("TPL_VAR_URL", $orderUrl);
$this->ObTpl->set_var("TPL_VAR_MAILFOOTER", $this->comFunc->m_mailFooter());
$message = $this->ObTpl->parse("return", "TPL_MAIL_FILE");
$obMail = new htmlMimeMail();
$obMail->setReturnPath(ADMIN_EMAIL);
$obMail->setFrom(SITE_NAME . "<" . ADMIN_EMAIL . ">");
#11-05-07
$obMail->setSubject("Your order from " . SITE_NAME . " has shipped!");
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
$htmlcontent = $message;
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $message));
$obMail->setHtml($htmlcontent, $txtcontent);
$obMail->buildMessage();
$result = $obMail->send(array($qryResult[0]->vEmail));
}
}
示例4: time
function m_sendPassword()
{
$this->obDb->query = "select iCustmerid_PK,vFirstName,vEmail,tmSignupDate FROM " . CUSTOMERS . " WHERE vEmail = '" . $this->request['email'] . "' AND iRegistered='1'";
$qryResult = $this->obDb->fetchQuery();
$rCount = $this->obDb->record_count;
if (isset($this->cart)) {
$action = "ecom/index.php?action=checkout.loginForm";
} else {
$action = "user/index.php?action=user.loginForm";
}
if ($rCount > 0) {
$requesttime = time();
$recoveryid = md5($qryResult[0]->iCustmerid_PK . $qryResult[0]->vFirstName . $qryResult[0]->vEmail . $qryResult[0]->tmSignupDate . $requesttime);
$this->obDb->query = "UPDATE " . CUSTOMERS . " SET vRecovery='" . $recoveryid . "',tRequestTime='" . $requesttime . "' WHERE iCustmerid_PK='" . $qryResult[0]->iCustmerid_PK . "' AND iRegistered='1'";
$this->obDb->updateQuery();
// $uniqID=uniqid (3);
$message = "Hi " . $this->libFunc->m_displayContent($qryResult[0]->vFirstName);
$message .= "<br><br>You requested to reset your login details for Username: " . $qryResult[0]->vEmail;
$message .= "<br><br>You can do so by visiting this <a href='" . SITE_URL . "user/index.php?action=user.recover&id=" . $recoveryid . "'>link</a>.";
$message .= "<br>If the link is not clickable, copy and paste this url into your browser: " . SITE_URL . "user/index.php?action=user.recover&id=" . $recoveryid;
$message .= "<br>You must click the above password within 24 hours of your request or the link will be deactivated.";
$message .= "<br><br>If you didn't request to reset your password, then please disregard this message.";
$message .= "<br><br>Best Regards,";
$message .= "<br><a href='" . SITE_URL . "'>" . SITE_NAME . "</a>";
$obMail = new htmlMimeMail();
$obMail->setReturnPath(ADMIN_EMAIL);
$obMail->setFrom(SITE_NAME . "<" . ADMIN_EMAIL . ">");
$obMail->setSubject("Login details from " . SITE_NAME);
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
$htmlcontent = $message;
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $message));
$obMail->setHtml($htmlcontent, $txtcontent);
$obMail->buildMessage();
$result = $obMail->send(array($qryResult[0]->vEmail));
$retUrl = $this->libFunc->m_safeUrl(SITE_URL . $action . "&mode=sent&msg=1");
$this->libFunc->m_mosRedirect($retUrl);
exit;
} else {
$retUrl = $this->libFunc->m_safeUrl(SITE_URL . $action . "&mode=lost&msg=2");
$this->libFunc->m_mosRedirect($retUrl);
exit;
}
}
示例5: template
function m_sendEmail()
{
$this->ObTpl = new template();
$this->ObTpl->set_file("TPL_VAR_ENQUIRYEMAIL", $this->templatePath . "enquiryMail.tpl.htm");
$this->ObTpl->set_var("TPL_VAR_SITEURL", SITE_URL);
$this->ObTpl->set_var("TPL_VAR_SITENAME", SITE_NAME);
$this->ObTpl->set_var("TPL_VAR_CURRENCY", CONST_CURRENCY);
$this->ObTpl->set_var("TPL_VAR_PRODUCTNAME", $this->libFunc->m_displayContent($this->request['productName']));
$this->ObTpl->set_var("TPL_VAR_SKU", $this->libFunc->m_displayContent($this->request['sku']));
$productUrl = $this->libFunc->m_safeUrl(SITE_URL . "ecom/index.php?action=ecom.pdetails&mode=" . $this->request['seoTitle']);
$this->ObTpl->set_var("TPL_VAR_PRODUCTURL", $productUrl);
$this->ObTpl->set_var("TPL_VAR_SKU", $this->libFunc->m_displayContent($this->request['sku']));
$this->ObTpl->set_var("TPL_VAR_NAME", $this->libFunc->m_displayContent($this->request['custname']));
$this->ObTpl->set_var("TPL_VAR_EMAIL", $this->libFunc->m_displayContent($this->request['email']));
$this->ObTpl->set_var("TPL_VAR_ADDRESS1", $this->libFunc->m_displayContent($this->request['address1']));
$this->ObTpl->set_var("TPL_VAR_ADDRESS2", $this->libFunc->m_displayContent($this->request['address2']));
$this->ObTpl->set_var("TPL_VAR_PHONE", $this->libFunc->m_displayContent($this->request['Phone']));
$this->ObTpl->set_var("TPL_VAR_COUNTRY", $this->libFunc->m_displayContent($this->request['sCountry']));
$this->ObTpl->set_var("TPL_VAR_COMMENTS", nl2br($this->libFunc->m_displayContent($this->request['comments'])));
$message = $this->ObTpl->parse("return", "TPL_VAR_ENQUIRYEMAIL");
$obMail = new htmlMimeMail();
$obMail->setReturnPath(ADMIN_EMAIL);
$obMail->setFrom($this->libFunc->m_displayContent($this->request['custname']) . "<" . $this->request['email'] . ">");
$obMail->setSubject(SITE_NAME . " Product Enquiry");
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
$htmlcontent = $message;
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $message));
$obMail->setHtml($htmlcontent, $txtcontent);
$obMail->buildMessage();
$result = $obMail->send(array(ADMIN_EMAIL));
$retUrl = $this->libFunc->m_safeUrl(SITE_URL . "ecom/index.php?action=enquiry.status");
$this->libFunc->m_mosRedirect($retUrl);
exit;
}
示例6: time
function m_sendMail()
{
$timestamp = time();
$accounturl = $this->libFunc->m_safeUrl(SITE_URL . "user/index.php?action=user.home");
$htmlfooter = "<br /><br />==================================================";
$htmlfooter .= "<br />You have requested to receive emails from " . SITE_NAME . " <br />\t\tIf you do not wish to receive any emails of this nature please <br />\t\t<a href='" . $accounturl . "'>Click here</a> to be removed from our list.\n\t\t<br />";
$htmlfooter .= "==================================================<br />";
$this->obDb->query = "select vSid,vSubject,tHtmlMail,tTextMail,vUserList,vVisitorList FROM " . EMAILS . " WHERE iMailid_PK = '" . $this->request['id'] . "'";
$qryResult = $this->obDb->fetchQuery();
$rCount = $this->obDb->record_count;
if ($rCount > 0) {
if (!isset($this->request['to'])) {
if ($qryResult[0]->vUserList != "All") {
$this->obDb->query = "SELECT vFirstName,vEmail,iMailList FROM " . LEADLIST . "," . CUSTOMERS . "\tWHERE iCustomerid_FK=iCustmerid_PK AND iLeadId_FK='" . $qryResult[0]->vUserList . "'";
} else {
$this->obDb->query = "SELECT vFirstName,vEmail,iMailList FROM " . CUSTOMERS . "\tWHERE iStatus =1 && iMailList!='0'";
}
$qryResult1 = $this->obDb->fetchQuery();
$rCount1 = $this->obDb->record_count;
if ($qryResult[0]->vVisitorList == "1") {
$this->obDb->query = "SELECT * FROM " . NEWSLETTERS;
$qryVs = $this->obDb->fetchQuery();
}
$start = count($qryResult1);
$a = 0;
if (isset($qryVs)) {
foreach ($qryVs as $k => $v) {
$qryResult1[$start]->vFirstName = "";
$qryResult1[$start]->vEmail = $v->vEmail;
$qryResult1[$start]->iMailList = 1;
$qryResult1[$start]->PKVisitor = $v->iSignup_PK;
$start = $start + 1;
$a = $a + 1;
}
$rCount1 = $rCount1 + $a;
}
$this->obDb->query = "SELECT '' as vFirstName, '' as iMailList, vEmail FROM " . NEWSLETTERS;
$newsletters = $this->obDb->fetchQuery();
$newsletterscount = $this->obDb->record_count;
$totalcount = $newsletterscount + $rCount1;
$qryResult1 = $qryResult1 + $newsletters;
if ($totalcount > 0) {
for ($i = 0; $i < $rCount1; $i++) {
if ($qryResult1[$i]->vFirstName != '') {
$message = "Hi " . $qryResult1[$i]->vFirstName;
} else {
$message = "Hi Customer ";
}
if (!empty($qryResult[0]->vSid)) {
$message .= "<br /><br /><a href=" . SITE_URL . "sid/" . $this->libFunc->m_displayContent($qryResult[0]->vSid) . ">" . SITE_URL . "sid/" . $this->libFunc->m_displayContent($qryResult[0]->vSid) . "</a><br />";
}
$obMail = new htmlMimeMail();
$obMail->setReturnPath(ADMIN_EMAIL);
$obMail->setFrom(SITE_NAME . "<" . ADMIN_EMAIL . ">");
$obMail->setSubject($qryResult[0]->vSubject);
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
if (isset($qryResult1[$i]->PKVisitor)) {
$accounturl = $this->libFunc->m_safeUrl(SITE_URL . "index.php?action=contactus.unsubscribe&mode=" . $qryResult1[$i]->PKVisitor);
$htmlfooter = "<br /><br />==================================================";
$htmlfooter .= "<br />You have requested to receive emails from " . SITE_NAME . " <br />\t\tIf you do not wish to receive any emails of this nature please <br />\t\t<a href='" . $accounturl . "'>Click here</a> to be removed from our list.<br />";
$htmlfooter .= "==================================================<br />";
}
if ($qryResult1[$i]->iMailList != 1) {
$htmlcontent = $message . "<br /><br />" . $this->libFunc->m_displayContent($qryResult[0]->tTextMail);
$htmlcontent .= $htmlfooter;
} else {
$htmlcontent = $message . "<br />" . $this->libFunc->m_displayContent1($qryResult[0]->tHtmlMail);
$htmlcontent .= $htmlfooter;
}
$plaintxt = $message . "<br />" . $this->libFunc->m_displayContent($qryResult[0]->tTextMail);
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $plaintxt));
$obMail->setHtml(nl2br($htmlcontent), $txtcontent);
$obMail->buildMessage();
$result = $obMail->send(array($qryResult1[$i]->vEmail));
}
}
$this->obDb->query = "UPDATE " . EMAILS . " SET \n\t\t\t\ttmSentDate ='{$timestamp}' \n\t\t\t\tWHERE iMailid_PK = '" . $this->request['id'] . "'";
$qryResult2 = $this->obDb->updateQuery();
} elseif ($this->request['to'] == 'test') {
$message = "Hi Admin";
$obMail = new htmlMimeMail();
$obMail->setReturnPath(ADMIN_EMAIL);
$obMail->setFrom(SITE_NAME . "<" . ADMIN_EMAIL . ">");
$obMail->setSubject($qryResult[0]->vSubject);
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
if (!empty($qryResult[0]->vSid)) {
$message .= "<br /><br /><a href=" . SITE_URL . "sid/" . $this->libFunc->m_displayContent($qryResult[0]->vSid) . ">" . SITE_URL . "sid/" . $this->libFunc->m_displayContent($qryResult[0]->vSid) . "</a><br />";
}
$htmlcontent1 = $message . "<br>" . $this->libFunc->m_displayContent($qryResult[0]->tTextMail);
$htmlcontent1 .= $htmlfooter;
$htmlcontent2 = $message . "<br>" . $this->libFunc->m_displayContent1($qryResult[0]->tHtmlMail);
$htmlcontent2 .= $htmlfooter;
$plaintxt = $message . "<br>" . $qryResult[0]->tTextMail;
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $plaintxt));
$obMail->setHtml(nl2br($htmlcontent1), $txtcontent);
$obMail->buildMessage();
$result = $obMail->send(array($this->request['email']));
$obMail->setHtml(nl2br($htmlcontent2), $txtcontent);
//.........这里部分代码省略.........
示例7: template
//.........这里部分代码省略.........
$this->ObTpl->parse("earnedmemberpoint_blk", "TPL_EMPOINTS_BLK");
}
# code added for getting total points
$this->obDb->query = "SELECT fMemberPoints FROM " . CUSTOMERS . " WHERE iCustmerid_PK=" . $qryResult[0]->iCustomerid_FK;
$rsCust = $this->obDb->fetchQuery();
if ($rsCust[0]->fMemberPoints > 0) {
$this->ObTpl->set_var("TPL_VAR_TMPOINTS", number_format($rsCust[0]->fMemberPoints, 0));
$memberpoint_price = MPOINTVALUE * $rsCust[0]->fMemberPoints;
$this->ObTpl->set_var("TPL_VAR_TMPOINTS_PRICE", number_format($memberpoint_price, 2, '.', ''));
$this->ObTpl->parse("totalmemberpoint_blk", "TPL_TMPOINTS_BLK");
}
#POSTAGE CALCULATION**************************
if ($qryResult[0]->fShipTotal > 0) {
$this->ObTpl->set_var("TPL_VAR_POSTAGEMETHOD", "Postage method (" . $qryResult[0]->vShipDescription . ")");
$this->ObTpl->set_var("TPL_VAR_POSTAGEPRICE", CONST_CURRENCY . number_format($qryResult[0]->fShipTotal, 2, '.', ''));
$this->grandTotal += number_format($qryResult[0]->fShipTotal, 2, '.', '');
$this->ObTpl->parse("postage_blk", "TPL_POSTAGE_BLK");
} elseif ($qryResult[0]->vShipDescription == "Free P&P") {
$this->ObTpl->set_var("TPL_VAR_POSTAGEMETHOD", $qryResult[0]->vShipDescription);
$this->ObTpl->set_var("TPL_VAR_POSTAGEPRICE", "No Charge");
$this->ObTpl->parse("postage_blk", "TPL_POSTAGE_BLK");
}
#COD PRICE(PAYMENT GATEWAY ADDITIONAL PRICE)
if ($qryResult[0]->fCodCharge > 0) {
$this->ObTpl->set_var("TPL_VAR_CODPRICE", number_format($qryResult[0]->fCodCharge, 2, '.', ''));
$this->grandTotal += number_format($qryResult[0]->fCodCharge, 2, '.', '');
$this->ObTpl->parse("cod_blk", "TPL_COD_BLK");
}
#CHECK FOR DISCOUNTS
if ($qryResult[0]->fDiscount != 0) {
$this->ObTpl->set_var("TPL_VAR_DISCOUNTPRICE", number_format($qryResult[0]->fDiscount, 2, '.', ''));
$this->grandTotal -= number_format($qryResult[0]->fDiscount, 2, '.', '');
$this->ObTpl->parse("discount_blk", "TPL_DISCOUNT_BLK");
$curTime = time();
$this->obDb->query = "UPDATE " . DISCOUNTS . " SET iState=0 WHERE vCode='" . $qryResult[0]->vDiscountCode . "' AND tmStartDate<{$curTime} AND tmEndDate>{$curTime} AND iUseonce=1";
$this->obDb->updateQuery();
}
#CHECK FOR GIFTCERTIFICATES
if ($qryResult[0]->fGiftcertTotal != 0) {
$this->grandTotal -= number_format($qryResult[0]->fGiftcertTotal, 2, '.', '');
$this->ObTpl->set_var("TPL_VAR_GIFTCERTPRICE", number_format($qryResult[0]->fGiftcertTotal, 2, '.', ''));
$this->ObTpl->parse("giftcert_blk", "TPL_GIFTCERT_BLK");
}
if ($qryResult[0]->fTaxPrice > 0) {
$this->ObTpl->set_var("TPL_VAR_TAXNAME", VAT_TAX_TEXT);
$this->ObTpl->set_var("TPL_VAR_VAT", number_format($qryResult[0]->fTaxRate, 2, '.', ''));
$this->ObTpl->set_var("TPL_VAR_VATPRICE", number_format($qryResult[0]->fTaxPrice, 2, '.', ''));
$this->ObTpl->parse("vat_blk", "TPL_VAT_BLK");
}
$this->grandTotal += number_format($qryResult[0]->fDiscount, 2, '.', '');
$this->ObTpl->set_var("TPL_VAR_CURRENTTOTAL", number_format($qryResult[0]->fTotalPrice, 2, '.', ''));
$this->ObTpl->parse("cart_blk", "TPL_CART_BLK");
}
}
#END ORDERS IF CONDITION
$message = $this->ObTpl->parse("return", "TPL_ORDERMAIL_FILE");
$obMail = new htmlMimeMail();
$obMail->setReturnPath(ADMIN_EMAIL);
$obMail->setFrom(SITE_NAME . "<" . ADMIN_EMAIL . ">");
$obMail->setSubject("Thank You for your order at " . SITE_NAME);
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
$htmlcontent = $message;
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $message));
$obMail->setHtml($htmlcontent, $txtcontent);
$obMail->buildMessage();
if (preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$/i", ADMIN_EMAIL)) {
if ($downloadVariable == "1" && ($qryResult[0]->vPayMethod == "mail" || $qryResult[0]->vPayMethod == "cod")) {
$result = $obMail->send(array($qryResult[0]->vEmail));
}
}
$obMail->setSubject("Thank You for your order at " . SITE_NAME);
$this->ObTpl->set_var("customer_blk", "");
$this->ObTpl->parse("admin_blk", "TPL_ADMIN_BLK");
$obMail->setSubject(SITE_NAME . " Invoice " . $qryResult[0]->iInvoice);
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
$message = $this->ObTpl->parse("return", "TPL_ORDERMAIL_FILE");
$htmlcontent = $message;
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $message));
$obMail->setHtml($htmlcontent, $txtcontent);
$obMail->buildMessage();
if (preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$/i", ORDER_EMAIL)) {
$result = $obMail->send(array(ORDER_EMAIL));
}
#WIRELESS EMAIL
$Name = $this->libFunc->m_displayContent($qryResult[0]->vFirstName) . " " . $this->libFunc->m_displayContent($qryResult[0]->vLastName);
$obMail->setSubject(SITE_NAME . " Invoice " . $qryResult[0]->iInvoice);
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
$wirelesscontent = "Invoice: " . $qryResult[0]->iInvoice . "<br />";
$wirelesscontent .= "Customer: " . $Name . "<br />";
$wirelesscontent .= "Total: " . CONST_CURRENCY . number_format($qryResult[0]->fTotalPrice, 2, '.', '');
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $wirelesscontent));
$obMail->setHtml($wirelesscontent, $txtcontent);
$obMail->buildMessage();
if (preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$/i", WIRELESS_EMAIL)) {
$result = $obMail->send(array(WIRELESS_EMAIL));
}
}
示例8: template
function m_sendEmail()
{
$this->ObTpl = new template();
$this->ObTpl->set_file("TPL_VAR_WISHEMAIL", $this->templatePath . "wishlistEmail.tpl.htm");
$this->ObTpl->set_block("TPL_VAR_WISHEMAIL", "TPL_PRODUCT_BLK", "product_blk");
$this->ObTpl->set_var("TPL_VAR_SITEURL", SITE_URL);
$this->ObTpl->set_var("TPL_VAR_SITENAME", SITE_NAME);
$this->ObTpl->set_var("TPL_VAR_CURRENCY", CONST_CURRENCY);
$this->ObTpl->set_var("product_blk", "");
$this->obDb->query = "SELECT vFirstName,vLastName,vEmail FROM " . CUSTOMERS . " WHERE iCustmerid_PK ='" . $_SESSION['userid'] . "'";
$rsCustomer = $this->obDb->fetchQuery();
$rsCustomer[0]->vFirstName;
$senderName = $this->libFunc->m_displayContent($rsCustomer[0]->vFirstName) . " " . $this->libFunc->m_displayContent($rsCustomer[0]->vLastName);
$this->ObTpl->set_var("TPL_VAR_SENDERNAME", $senderName);
$this->ObTpl->set_var("TPL_VAR_MESSAGE", nl2br($this->libFunc->m_displayContent($this->request['comment'])));
$this->obDb->query = "SELECT iShopWishid_PK,vTitle,vQuantity,vSeoTitle,iTaxable,fPrice FROM " . PRODUCTS . "," . WISHLIST . " WHERE iProductid_FK=iProdid_PK AND iCustomerid_FK='" . $_SESSION['userid'] . "'";
$rowProduct = $this->obDb->fetchQuery();
$productCount = $this->obDb->record_count;
if ($productCount > 0) {
for ($i = 0; $i < $productCount; $i++) {
$productUrl = SITE_URL . "ecom/index.php?action=ecom.pdetails&mode=" . $rowProduct[$i]->vSeoTitle;
$this->ObTpl->set_var("TPL_VAR_PRODUCTURL", $this->libFunc->m_safeUrl($productUrl));
$this->ObTpl->set_var("TPL_VAR_ID", $this->libFunc->m_displayContent($rowProduct[$i]->iShopWishid_PK));
$this->ObTpl->set_var("TPL_VAR_TITLE", $this->libFunc->m_displayContent($rowProduct[$i]->vTitle));
if ($rowProduct[$i]->iTaxable == 1) {
#GETTING VAT PRICE
$vatPercent = $this->libFunc->m_vatCalculate();
$vatPrice = number_format($vatPercent * $rowProduct[$i]->fPrice / 100 + $rowProduct[$i]->fPrice, 2);
$this->ObTpl->set_var("TPL_VAR_PRICE", $this->libFunc->m_displayContent($rowProduct[$i]->fPrice) . " (" . CONST_CURRENCY . $vatPrice . " inc. Vat)");
} else {
$this->ObTpl->set_var("TPL_VAR_PRICE", $this->libFunc->m_displayContent($rowProduct[$i]->fPrice));
}
$this->ObTpl->parse("product_blk", "TPL_PRODUCT_BLK", true);
}
}
$message = $this->ObTpl->parse("return", "TPL_VAR_WISHEMAIL");
$obMail = new htmlMimeMail();
$obMail->setReturnPath(ADMIN_EMAIL);
$obMail->setFrom($this->libFunc->m_displayContent(SITE_NAME) . "<" . ADMIN_EMAIL . ">");
$obMail->setSubject("Wishlist from " . $senderName . " at " . SITE_NAME);
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
$htmlcontent = $message;
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $message));
$obMail->setHtml($htmlcontent, $txtcontent);
$obMail->buildMessage();
$this->obDb->query = "SELECT iWishid_PK,vEmail FROM " . WISHEMAILS . " WHERE iCustomerid_FK='" . $_SESSION['userid'] . "'";
$rsWishEmail = $this->obDb->fetchQuery();
$rsCount = $this->obDb->record_count;
if ($rsCount > 0) {
$toArray = array();
for ($i = 0; $i <= $rsCount - 1; $i++) {
$toArray[$i] = $rsWishEmail[$i]->vEmail;
}
$result = $obMail->send($toArray);
}
$retUrl = $this->libFunc->m_safeUrl(SITE_URL . "ecom/index.php?action=wishlist.display&mode=dspmsg");
$this->libFunc->m_mosRedirect($retUrl);
}
示例9: trim
function m_forgetPassword()
{
$this->obDb->query = "select iAdminid_PK,vUsername,vPassword,vEmail FROM " . ADMINUSERS . " WHERE vUsername = '" . trim($this->request['username']) . "' AND vEmail='" . trim($this->request['email']) . "'";
$qryResult = $this->obDb->fetchQuery();
$rCount = $this->obDb->record_count;
$uniqID = uniqid(3);
if ($rCount > 0) {
$this->libFunc->obDb = $this->obDb;
$this->libFunc->m_removeBans($qryResult[0]->vUsername);
$message = "Hi " . $qryResult[0]->vUsername;
$message .= "<br><br>Here are your login details:";
$message .= "<br><br>Username: " . $qryResult[0]->vUsername;
$message .= "<br>Password: " . $uniqID;
$obMail = new htmlMimeMail();
$obMail->setReturnPath(ADMIN_EMAIL);
$obMail->setFrom(SITE_NAME . "<" . ADMIN_EMAIL . ">");
$obMail->setSubject("Login details from " . SITE_NAME);
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
$htmlcontent = $message;
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $message));
$obMail->setHtml($htmlcontent, $txtcontent);
$obMail->buildMessage();
$result = $obMail->send(array($qryResult[0]->vEmail));
$this->obDb->query = "UPDATE " . ADMINUSERS . " SET vPassword=password('" . $uniqID . "') WHERE iAdminid_PK=" . $qryResult[0]->iAdminid_PK;
$qryResult = $this->obDb->updateQuery();
$this->libFunc->m_mosRedirect(SITE_URL . "adminindex.php?msg=3");
} else {
$this->libFunc->m_mosRedirect(SITE_URL . "adminindex.php?action=forget&msg=4");
}
}
示例10: htmlMimeMail
function m_sendStockMail()
{
$this->obDb->query = "SELECT vSku,vTitle,iInventory,iUseinventory FROM " . PRODUCTS . " WHERE iProdId_PK='" . $this->productId . "'";
$rs = $this->obDb->fetchQuery();
#TO CHECK STOCK CONTROL ENABLED
if ($rs[0]->iUseinventory == 1) {
if ($rs[0]->iInventory < 1) {
$message = "========================================<br />";
$message .= "Low stock levels for " . $this->libFunc->m_displayContent($rs[0]->vTitle) . "<br />";
$message .= "========================================<br />";
$message .= "The quantity for the following product has reached reorder levels:<br />";
$message .= "<br>Product Code: " . $this->libFunc->m_displayContent($rs[0]->vSku);
$message .= "<br>Product Title: " . $this->libFunc->m_displayContent($rs[0]->vTitle);
$message .= "<br>Quantity on hand: " . $rs[0]->iInventory;
$obMail = new htmlMimeMail();
$obMail->setReturnPath(ADMIN_EMAIL);
$obMail->setFrom(SITE_NAME . "<" . ORDER_EMAIL . ">");
$obMail->setSubject("Stocks Low for " . $rs[0]->vTitle);
$obMail->setCrlf("\n");
//to handle mails in Outlook Express
$htmlcontent = $message;
$txtcontent = preg_replace("/<([^>]+)>/", "", preg_replace("/<br(\\/{0,1})>/", "\r\n", $message));
$obMail->setHtml($htmlcontent, $txtcontent);
$obMail->buildMessage();
$result = $obMail->send(array(ADMIN_EMAIL));
}
}
}
示例11: htmlMimeMail
* Example of usage. This example shows
* how to use the class to send an email
* attached to another email. First email
* built is html/text with an embedded image
* and attachment. This is then attached
* to the second email which is plain text.
*
* Create the mail object.
*/
$mail_1 = new htmlMimeMail();
/**
* This call is usually not necessary unless you're sending the final
* mail via SMTP (Qmail won't send mail with bare LFs and you must
* therefore use CRLF), but setting this explicitly doesnt hurt.
*/
$mail_1->setCrlf("\n");
/**
* First email.
*/
$mail_1->setHTML($mail_1->getFile('example.html'), $mail_1->getFile('example.txt'), dirname(__FILE__) . '/');
/**
* Add the attachment
*/
$mail_1->addAttachment($mail_1->getFile('example.zip'), 'example.zip', 'application/zip');
/**
* Don't send this email, but use the
* get_rfc822() method to assign it to a
* variable.
*/
$mail_1->setReturnPath('return@example.com');
$mail_1->setFrom('John Doe <john.doe@example.com>');