当前位置: 首页>>代码示例>>PHP>>正文


PHP htmlMimeMail类代码示例

本文整理汇总了PHP中htmlMimeMail的典型用法代码示例。如果您正苦于以下问题:PHP htmlMimeMail类的具体用法?PHP htmlMimeMail怎么用?PHP htmlMimeMail使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了htmlMimeMail类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: m_sendMail

 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));
 }
开发者ID:penkoh,项目名称:TradingEye-V7.1.1,代码行数:29,代码来源:cmsContent_db.php

示例2: EmailSuppliers

 function EmailSuppliers()
 {
     $EmailText = _('This email has been automatically generated by KwaMoja') . "\n";
     $EmailText .= _('You are invited to Tender for the following products to be delivered to') . ' ' . $_SESSION['CompanyRecord']['coyname'] . "\n";
     $EmailText .= _('Tender number') . ': ' . $this->TenderId . "\n";
     $EmailText .= _(' Quantity ') . ' ' . _(' Unit ') . ' ' . _(' Item Description') . "\n";
     foreach ($this->LineItems as $LineItem) {
         $EmailText .= $LineItem->Quantity . ' ' . $LineItem->Units . ' ' . $LineItem->ItemDescription . "\n";
     }
     $Subject = _('Tender received from') . ' ' . $_SESSION['CompanyRecord']['coyname'];
     $Headers = 'From: ' . $_SESSION['PurchasingManagerEmail'] . "\r\n" . 'Reply-To: ' . $_SESSION['PurchasingManagerEmail'] . "\r\n" . 'X-Mailer: PHP/' . phpversion();
     if ($_SESSION['SmtpSetting'] == 1) {
         include 'includes/htmlMimeMail.php';
         $mail = new htmlMimeMail();
         $mail->setText($EmailText);
         $mail->setSubject($Subject);
         $mail->setFrom($_SESSION['PurchasingManagerEmail']);
         $mail->setHeader('Reply-To', $_SESSION['PurchasingManagerEmail']);
         $mail->setCc($_SESSION['PurchasingManagerEmail']);
         //Set this as a copy for filing purpose
     }
     foreach ($this->Suppliers as $Supplier) {
         $result = mail($Supplier->EmailAddress, $Subject, $EmailText, $Headers);
         if ($_SESSION['SmtpSetting'] == 0) {
             $result = mail($Supplier->EmailAddress, $Subject, $EmailText, $Headers);
         } else {
             $result = SendmailBySmtp($mail, array($Supplier->EmailAddress, $_SESSION['PurchasingManagerEmail']));
         }
     }
 }
开发者ID:rrsc,项目名称:KwaMoja,代码行数:30,代码来源:DefineTenderClass.php

示例3: m_reviewAdd

 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;
 }
开发者ID:penkoh,项目名称:TradingEye-V7.1.1,代码行数:46,代码来源:shop_db.php

示例4: sendHTMLMail

function sendHTMLMail($from, $to, $subject, $body)
{
    $mail = new htmlMimeMail();
    $mail->setFrom($from);
    $mail->setSubject($subject);
    $mail->setHTML($body);
    if (is_array($to)) {
        $result = $mail->send($to);
    } else {
        $result = $mail->send(array($to));
    }
    return $result;
}
开发者ID:dpecos,项目名称:npshop,代码行数:13,代码来源:NPLib_Net.php

示例5: SendMail_HTML

function SendMail_HTML($from, $to, $subj, $body, $attach = "")
{
    // sending email as html
    //global $SERVER_SOFTWARE;
    $mail = new htmlMimeMail();
    $mail->setFrom($from);
    $mail->setSubject($subj);
    $mail->setHTML($body);
    $mail->setHTMLCharset('windows-1251');
    $mail->setHeadCharset('windows-1251');
    if (is_array($attach)) {
        $total = count($attach);
        for ($i = 0; $i < $total; $i++) {
            if (file_exists($attach[$i])) {
                $attach_data = $mail->getFile($attach[$i]);
                $mail->addAttachment($attach_data, basename($attach[$i]), '');
            }
        }
    } elseif (file_exists($attach) && $attach != "") {
        $attach_data = $mail->getFile($attach);
        $mail->addAttachment($attach_data, basename($attach), '');
    }
    $result = $mail->send(array($to));
    return $result;
}
开发者ID:NioFBI,项目名称:majordomo,代码行数:25,代码来源:general.class.php

示例6: m_sendConfirmation

 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));
     }
 }
开发者ID:penkoh,项目名称:TradingEye-V7.1.1,代码行数:33,代码来源:order_db.php

示例7: _

             exit;
         }
     }
 }
 //End FPDI Concat
 /*	if ($len <1020){
 		include('includes/header.inc');
 		echo '<p>' . _('There were no transactions to print in the range selected');
 		include('includes/footer.inc');
 		exit;
 	}*/
 if (isset($_GET['Email'])) {
     //email the invoice to address supplied
     include 'includes/header.inc';
     include 'includes/htmlMimeMail.php';
     $mail = new htmlMimeMail();
     $filename = $_SESSION['reports_dir'] . '/Invoice.pdf';
     $fp = fopen($_SESSION['reports_dir'] . '/Invoice.pdf', 'wb');
     fwrite($fp, $pdfcode);
     fclose($fp);
     $attachment = $mail->getFile($filename);
     $mail->setText(_('Please find attached') . ' ' . $InvOrCredit . ' ' . $_GET['FromTransNo']);
     $mail->SetSubject($InvOrCredit . ' ' . $_GET['FromTransNo']);
     $mail->addAttachment($attachment, $filename, 'application/pdf');
     $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>');
     $result = $mail->send(array($_GET['Email']));
     unlink($filename);
     //delete the temporary file
     $title = _('Emailing') . ' ' . $InvOrCredit . ' ' . _('Number') . ' ' . $FromTransNo;
     include 'includes/header.inc';
     echo "<p>{$InvOrCredit} " . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('has been emailed to') . ' ' . $_GET['Email'];
开发者ID:bodi000,项目名称:weberp-cvs,代码行数:31,代码来源:PrintCustTrans.php

示例8: htmlMimeMail

                     break;
                 case 'WH':
                     /* The warehouse keeper details - don't think we care about this either*/
                     break;
             }
             break;
             /*end of NAD segment */
             /* UP TO HERE NEED TESTER */
     }
     /*end case  Seg Tag*/
 }
 /*end while get next line of message */
 /*Thats the end of the message or had to abort */
 if (mb_strlen($EmailText) > 10) {
     /*Now send the email off to the appropriate person */
     $mail = new htmlMimeMail();
     $mail->setText($EmailText);
     $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . "<" . $_SESSION['CompanyRecord']['email'] . ">");
     if ($TryNextFile == True) {
         /*had to abort this message */
         /* send the email to the sysadmin  - get email address from users*/
         $Result = DB_query("SELECT realname, email FROM www_users WHERE fullaccess=7 AND email <>''", $db);
         if (DB_num_rows($Result) == 0) {
             /*There are no sysadmins with email address specified */
             $Recipients = array("'tim' <tim@localhost>");
         } else {
             /*Make an array of the sysadmin recipients */
             $Recipients = array();
             $i = 0;
             while ($SysAdminsRow = DB_fetch_array($Result)) {
                 $Recipients[$i] = "'" . $SysAdminsRow['realname'] . "' <" . $SysAdminsRow['email'] . ">";
开发者ID:patmark,项目名称:weberp-elct,代码行数:31,代码来源:EDIProcessOrders.php

示例9: date

     $LeftOvers = $pdf->addTextWrap($FormDesign->OrderTotal->x, $Page_Height - $FormDesign->OrderTotal->y, $FormDesign->OrderTotal->Length, $FormDesign->OrderTotal->FontSize, $DisplayOrderTotal, 'right');
 }
 /*end if there are order details to show on the order*/
 //} /* end of check to see that there was an order selected to print */
 $Success = 1;
 //assume the best and email goes - has to be set to 1 to allow update status
 if ($MakePDFThenDisplayIt) {
     $pdf->OutputD($_SESSION['DatabaseName'] . '_PurchaseOrder_' . $OrderNo . '_' . date('Y-m-d') . '.pdf');
     $pdf->__destruct();
 } else {
     /* must be MakingPDF to email it */
     $PdfFileName = $_SESSION['DatabaseName'] . '_PurchaseOrder_' . $OrderNo . '_' . date('Y-m-d') . '.pdf';
     $pdf->Output($_SESSION['reports_dir'] . '/' . $PdfFileName, 'F');
     $pdf->__destruct();
     include 'includes/htmlMimeMail.php';
     $mail = new htmlMimeMail();
     $attachment = $mail->getFile($_SESSION['reports_dir'] . '/' . $PdfFileName);
     $mail->setText(_('Please find herewith our purchase order number') . ' ' . $OrderNo);
     $mail->setSubject(_('Purchase Order Number') . ' ' . $OrderNo);
     $mail->addAttachment($attachment, $PdfFileName, 'application/pdf');
     $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>');
     $Success = $mail->send(array($_POST['EmailTo']));
     if ($Success == 1) {
         $title = _('Email a Purchase Order');
         include 'includes/header.inc';
         echo '<div class="centre"><br /><br /><br />';
         prnMsg(_('Purchase Order') . ' ' . $OrderNo . ' ' . _('has been emailed to') . ' ' . $_POST['EmailTo'] . ' ' . _('as directed'), 'success');
     } else {
         //email failed
         $title = _('Email a Purchase Order');
         include 'includes/header.inc';
开发者ID:BackupTheBerlios,项目名称:kwamoja,代码行数:31,代码来源:PO_PDFPurchOrder.php

示例10: array

The configuration of this script requires the id of the sales analysis report to send
and an array of the receipients */
/*The following three variables need to be modified for the report - the company database to use and the receipients */
/*The Sales report to send */
$_GET['ReportID'] = 2;
/*The company database to use */
$DatabaseName = 'kwamojademo';
/*The people to receive the emailed report */
$Recipients = array('"Root" <root@localhost>', '"' . _('someone else') . '" <someoneelese@sowhere.com>');
$AllowAnyone = true;
include 'includes/session.inc';
include 'includes/ConstructSQLForUserDefinedSalesReport.inc';
include 'includes/PDFSalesAnalysis.inc';
include 'includes/htmlMimeMail.php';
$mail = new htmlMimeMail();
if ($Counter > 0) {
    /* the number of lines of the sales report is more than 0  ie there is a report to send! */
    $pdfcode = $pdf->output();
    $fp = fopen($_SESSION['reports_dir'] . '/SalesReport.pdf', 'wb');
    fwrite($fp, $pdfcode);
    fclose($fp);
    $attachment = $mail->getFile($_SESSION['reports_dir'] . '/SalesReport.pdf');
    $mail->setText(_('Please find herewith sales report'));
    $mail->SetSubject(_('Sales Analysis Report'));
    $mail->addAttachment($attachment, 'SalesReport.pdf', 'application/pdf');
    $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>');
    $result = $mail->send($Recipients);
} else {
    $mail->setText(_('Error running automated sales report number') . ' ' . $ReportID);
    $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>');
开发者ID:BackupTheBerlios,项目名称:kwamoja,代码行数:30,代码来源:MailSalesReport.php

示例11: locale_money_format

        /*Then set up a new page */
        $PageNumber++;
        include 'includes/PDFChequeListingPageHeader.inc';
    }
    /*end of new page header  */
}
/* end of while there are customer receipts in the batch to print */
$YPos -= $line_height;
$LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 60, $FontSize, locale_money_format($TotalCheques, $Currency), 'right');
$LeftOvers = $pdf->addTextWrap($Left_Margin + 65, $YPos, 300, $FontSize, _('TOTAL') . ' ' . $Currency . ' ' . _('CHEQUES'), 'left');
$ReportFileName = $_SESSION['DatabaseName'] . '_ChequeListing_' . date('Y-m-d') . '.pdf';
$pdf->OutputD($ReportFileName);
//UldisN
$pdf->__destruct();
//UldisN
if ($_POST['Email'] == 'Yes') {
    if (file_exists($_SESSION['reports_dir'] . '/' . $ReportFileName)) {
        unlink($_SESSION['reports_dir'] . '/' . $ReportFileName);
    }
    $fp = fopen($_SESSION['reports_dir'] . '/' . $ReportFileName, 'wb');
    fwrite($fp, $pdfcode);
    fclose($fp);
    include 'includes/htmlMimeMail.php';
    $mail = new htmlMimeMail();
    $attachment = $mail->getFile($_SESSION['reports_dir'] . '/' . $ReportFileName);
    $mail->setText(_('Please find herewith payments listing from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']);
    $mail->addAttachment($attachment, 'PaymentListing.pdf', 'application/pdf');
    $mail->setFrom(array('"' . $_SESSION['CompanyRecord']['coyname'] . '" <' . $_SESSION['CompanyRecord']['email'] . '>'));
    /* $ChkListingRecipients defined in config.php */
    $result = $mail->send($ChkListingRecipients);
}
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:PDFChequeListing.php

示例12: mail_send

 function mail_send($email_from, $subject, $sendto_email, $html_body, $plain_body, $randpath, $randfile)
 {
     $file = $html_mime_mail = new htmlMimeMail();
     $html_mime_mail->setFrom($email_from);
     $html_mime_mail->setSubject($subject);
     $html_mime_mail->setHtml($html_body, $plain_body);
     if ($randpath != '' && $randfile != '') {
         $html_mime_mail->addAttachment($html_mime_mail->getFile($randpath . $randfile), $randfile);
     }
     $success = $html_mime_mail->send(array($sendto_email), 'smtp');
     return $success;
 }
开发者ID:trungjc,项目名称:collegeprospectnetwork,代码行数:12,代码来源:common_functions.php

示例13: send_mail

/**
 * Send e-mails
 *
 * @param String $to      Recipient mail address
 * @param String $subject Subject
 * @param String $message Mail content
 * @param String $from    Sender mail address
 * @param Array  $headers Additional mail headers
 *
 * @return Bool Returs true if mail has been sent
 */
function send_mail($to, $subject, $message, $from, $headers = NULL)
{
    global $configuration;
    $mail = new htmlMimeMail();
    if ($configuration['mail_type'] == 'smtp') {
        $type = 'smtp';
        $smtp = $configuration['smtp'];
        $mail->setSMTPParams($smtp['host'], $smtp['port'], $smtp['helo'], $smtp['auth'], $smtp['user'], $smtp['pass']);
    } else {
        $type = 'mail';
    }
    // Set additional mail headers
    $html = false;
    if (is_array($headers)) {
        foreach ($headers as $name => $value) {
            $mail->setHeader($name, $value);
            if (strtolower($name) == 'content-type' and preg_match('#text/html#i', $value)) {
                $mail->setHtmlCharset($configuration['character_set']);
                $mail->setHtml($message);
                $html = true;
            }
            // Set return path
            if (strtolower($name) == 'return-path') {
                $mail->setReturnPath($value);
            }
        }
    }
    $mail->setHeadCharset($configuration['character_set']);
    $mail->setFrom($from);
    $mail->setSubject($subject);
    if ($html != true) {
        $configuration['character_set'];
        $mail->setTextCharset($configuration['character_set']);
        $mail->setText($message);
    }
    $result = $mail->send(array($to), $type);
    if ($result) {
        return true;
    }
}
开发者ID:Nenet,项目名称:Urban,代码行数:51,代码来源:functions.inc.php

示例14: subscriber_sendspam

 function subscriber_sendspam()
 {
     if (!$this->haveAccessTo('sendspam-subscribers')) {
         return $this->showAccessDenied();
     }
     $aData = array();
     $aSelectedEmails = func::POSTGET('user_id', false);
     if (is_array($aSelectedEmails)) {
         $aSelectedEmails = array_unique($aSelectedEmails);
     }
     $sFrom = self::SENDSPAM_FROM;
     if (func::isPostMethod() || func::POSTGET('submit') == 'send') {
         $sSubject = func::POSTGET('subject', true);
         $sBody = func::POSTGET('body', true);
         if (!$sSubject) {
             $this->errors->set('no_subject');
         }
         if (!$sBody) {
             $this->errors->set('no_body');
         }
         if (!is_array($aSelectedEmails) || count($aSelectedEmails) == 0) {
             $this->errors->set('no_receivers');
         }
         if ($this->errors->no()) {
             include PATH_CORE . 'mail/htmlMimeMail.php';
             @set_time_limit(0);
             $nCountSuccessfull = 0;
             $nCountUnsuccessfull = 0;
             $aEmailsSuccessfull = array();
             $oMail = new htmlMimeMail();
             $oMail->setSubject($sSubject);
             $oMail->setFrom($sFrom);
             $oMail->setText($sBody);
             for ($i = 0; $i < count($aSelectedEmails); $i++) {
                 if (@$oMail->send(array($aSelectedEmails[$i]))) {
                     $nCountSuccessfull++;
                     $aEmailsSuccessfull[] = $aSelectedEmails[$i];
                 } else {
                     $nCountUnsuccessfull++;
                 }
             }
             if ($nCountUnsuccessfull == 0) {
                 $this->adminRedirect(Errors::SUCCESSFULL, 'subscriber_sendspam');
             } else {
                 $this->errors->set('result_of_sendmail', false, 'успешно - ' . $nCountSuccessfull . ' / с ошибками - ' . $nCountUnsuccessfull);
                 //leave only unsuccessfull emails :)
                 $aSelectedEmails = array_diff($aSelectedEmails, $aEmailsSuccessfull);
             }
         }
         $aData = $_REQUEST;
     }
     $aSubscribers = $this->db->select('SELECT id, email, name FROM ' . DB_PREFIX . 'subscribers ORDER BY name');
     $htmlExistsOptions = '';
     $htmlReceiversOptions = '';
     for ($i = 0; $i < count($aSubscribers); $i++) {
         if (!$aSubscribers[$i]['email']) {
             continue;
         }
         $htmlItem = '<option value="' . $aSubscribers[$i]['email'] . '">' . $aSubscribers[$i]['name'] . ' &lt;' . $aSubscribers[$i]['email'] . '&gt; </option>';
         if (is_array($aSelectedEmails) && in_array($aSubscribers[$i]['email'], $aSelectedEmails)) {
             $htmlReceiversOptions .= $htmlItem;
         } else {
             $htmlExistsOptions .= $htmlItem;
         }
     }
     $aData['from'] = $sFrom;
     $this->tplAssign('aData', $aData);
     $this->tplAssign("exists_values", $htmlExistsOptions);
     $this->tplAssign("sendtousers_options", $htmlReceiversOptions);
     return $this->tplFetch('admin.subscriber.sendspam.tpl');
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:71,代码来源:sendmail.adm.class.php

示例15: m_sendPassword

 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:&nbsp;" . $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;
     }
 }
开发者ID:penkoh,项目名称:TradingEye-V7.1.1,代码行数:44,代码来源:user_interface.php


注:本文中的htmlMimeMail类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。