本文整理汇总了PHP中htmlMimeMail::send方法的典型用法代码示例。如果您正苦于以下问题:PHP htmlMimeMail::send方法的具体用法?PHP htmlMimeMail::send怎么用?PHP htmlMimeMail::send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htmlMimeMail
的用法示例。
在下文中一共展示了htmlMimeMail::send方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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));
}
示例3: send
function send($recipients, $type = NULL)
{
global $application;
$mail_settings = modApiFunc("Configuration", "getMailSettings");
if ($mail_settings['MAIL_TYPE'] != 1 && $mail_settings['MAIL_TYPE'] != 2) {
$type = 'mail';
} else {
$type = $mail_settings['MAIL_TYPE'] == 1 ? 'mail' : 'smtp';
}
$res = parent::send($recipients, $type);
return $res;
}
示例4: 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;
}
示例5: send
public static function send($from, $to, $subject, $body, array $attachments = null, array $headers = null)
{
if (empty($to)) {
Logger::trace("mail not sent: no recipients: {$subject}");
return;
}
$config = Context::last()->config;
if (empty($from)) {
if (!($from = $config->get('modules/mail/from'))) {
$from = "Molinos.CMS <no-reply@" . MCMS_HOST_NAME . ">";
}
}
if (strstr($body, '<html>') === false) {
$body = '<html><head><title>' . html::plain($subject) . '</title></head><body>' . $body . '</body></html>';
}
if (!is_array($to)) {
$to = preg_split('/, */', $to, -1, PREG_SPLIT_NO_EMPTY);
}
Logger::log(sprintf('to=%s, subject=%s', join(',', $to), $subject), 'mail');
$mail = new htmlMimeMail();
if ('smtp' == ($transport = ($server = $config->get('modules/mail/server')) ? 'smtp' : 'mail')) {
$mail->setSMTPParams($server);
}
$mail->setFrom($from);
$mail->setSubject($subject);
$mail->setHtml(self::fixhtml($body));
$mail->setTextCharset('UTF-8');
$mail->setTextEncoding('base64');
$mail->setHTMLCharset('UTF-8');
$mail->setHTMLEncoding('UTF-8');
$mail->setHeadCharset('UTF-8');
foreach ((array) $attachments as $file) {
$mail->addAttachment($file['data'], $file['name'], $file['type']);
}
foreach ((array) $headers as $k => $v) {
if (!empty($v)) {
$mail->setHeader($k, $v);
}
}
return $mail->send($to, $transport);
}
示例6: welcome_email_send
function welcome_email_send(&$registration_details)
{
global $main_smarty, $current_user;
include_once mnminclude . 'user.php';
// Check User ID != 0
if ($registration_details['id'] > 0) {
$username = $registration_details['username'];
$password = $registration_details['password'];
$email = $registration_details['email'];
$id = $registration_details['id'];
$user = new User();
$user->id = $id;
// Check User Data
if ($user->read()) {
include_once mnmmodules . 'welcome_email/includes/htmlMimeMail.php';
// Current Date/Time of Server
$thisDate = date("M d, Y");
$thisTime = date("H:i:s");
// User Information
$thisUserName = $username;
$thisUserEmail = $email;
// Pligg Information
$siteName = $main_smarty->get_config_vars('PLIGG_Visual_Name');
$siteEmail = $main_smarty->get_config_vars('PLIGG_PassEmail_From');
$installedURL = my_base_url;
$installedBase = my_pligg_base;
// Email Subject
$messageSubject = "Welcome to " . $siteName . "!";
// Email Message
$messageText = "Hello, " . $thisUserName . ".\n\n";
$messageText .= "Your account at " . $siteName . " has been successfully set up.\n\n";
$messageText .= "Please keep the below information for future reference:\n";
$messageText .= "-----------------------------------------\n\n";
$messageText .= " Login URL: " . $installedURL . $installedBase . "/login.php\n\n";
$messageText .= " Username.: " . $thisUserName . "\n";
$messageText .= " Password.: (password choosen when registered)\n\n";
$messageText .= "-----------------------------------------\n";
$messageText .= "Email has been automatically generated on " . $thisDate . " at " . $thisTime . ".\n";
// Setup Mail Class
$mail = new htmlMimeMail();
// Set Mail Body Text
$mail->setText($messageText);
// Set Mail From
$mail->setFrom($siteName . " <" . $siteEmail . ">");
// Set Mail Subject
$mail->setSubject($messageSubject);
// Send Mail
$mail->send(array($thisUserEmail));
} else {
// Unable to find user data
echo "Module Error #2";
die;
// To disable this error message and continue with registration,
// remove the above ELSE statement this comment is within.
}
} else {
// Unable to find User ID
echo "Module Error #1";
die;
}
}
示例7: str_replace
$cTexto = str_replace("##Contenido##", $cContTexto, $cTexto);
$cTexto = str_replace("##Nombre##", $aRegistro["NwsSuscNombre"], $cTexto);
$cTexto = str_replace("##EMail##", $aRegistro["NwsSuscMail"], $cTexto);
$cTexto = str_replace("##ClaveBaja##", md5("#".$aRegistro["NwsSuscCodigo"]."#".$aRegistro["NwsSuscMail"]."#"), $cTexto);
$cHTML = $oMail->getFile("./Newsletter/Newsletter.html");
$cHTML = str_replace("##Contenido##", $cContHTML, $cHTML);
$cHTML = str_replace("##Nombre##", $aRegistro["NwsSuscNombre"], $cHTML);
$cHTML = str_replace("##EMail##", $aRegistro["NwsSuscMail"], $cHTML);
$cHTML = str_replace("##ClaveBaja##", md5("#".$aRegistro["NwsSuscCodigo"]."#".$aRegistro["NwsSuscMail"]."#"), $cHTML);
$oMail->setHtml($cHTML, $cTexto, '../');
$oMail->setFrom($cDesdeMail);
$oMail->setReturnPath($cRetorMail);
$oMail->setSubject($cAsunto);
$oMail->send(array($aRegistro["NwsSuscMail"]));
unset($oMail);
if ($_GET['Desde']=='EnvNews') {
$cSql = "INSERT INTO NwsEnvio (NwsEdicCodigo, NwsSuscCodigo) VALUES (" . $_REQUEST["Codigo"] . ", " . $aRegistro["NwsSuscCodigo"] . ")";
$nResulIns = mysql_query ($cSql) or fErrorSQL($conf["EstadoSitio"], "<br /><br /><b>Error en la consulta:</b><br />" . $cSql . "<br /><br /><b>Tipo de error:</b><br />" . mysql_error() . "<br />");
}
?>
<script language="JavaScript">
changeCaption('EstadoEnvio', '<?php
echo $cEstado;
?>
- <?php
echo str_replace("'", "\\'", $aRegistro["NwsSuscNombre"]);
示例8: date
/*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);
}
示例9: class
$mail->setHeader('X-Mailer', 'HTML Mime mail class (http://www.phpguru.org)');
//SEND TO BELOW /
if (isset($_COOKIE["goerie"]))
{
if($mail->send(array('info@glit.edu', 'jonm@glit.edu', 'trishap@glit.edu'), 'mail')){
$responder->send(array($email), 'mail');
print "<h3>Thank you for Submitting an Application!</h3>";
}else{
print "<h3>An error has occured!</h3>";
print "<p>We are sorry for the inconvenience, you may try to submit again.</p>";
}
}elseif (isset($_COOKIE["reachlocal_display"])){
示例10: debtortranstaxes
$DbgMsg = _('The following SQL to insert the debtor transaction record was used');
$Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);
$DebtorTransID = DB_Last_Insert_ID($db, 'debtortrans', 'id');
$SQL = 'INSERT INTO debtortranstaxes (debtortransid,
taxauthid,
taxamount)
VALUES (' . $DebtorTransID . ',
' . $TaxAuthID . ',
' . $Tax['FXAmount'] / $CurrencyRate . ')';
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because');
$DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used');
$Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);
$SQL = 'COMMIT';
$Result = DB_query($SQL, $db);
echo _('Invoice number') . ' ' . $InvoiceNo . ' ' . _('processed') . '<BR>';
$EmailText .= "\n" . _('This recurring order was set to produce the invoice automatically on invoice number') . ' ' . $InvoiceNo;
}
/*end if the recurring order is set to auto invoice */
if (IsEmailAddress($RecurrOrderRow['email'])) {
$mail = new htmlMimeMail();
$mail->setText($EmailText);
$mail->setSubject(_('Recurring Order Created Advice'));
$mail->setFrom($_SESSION['CompanyRecord']['coyname'] . "<" . $_SESSION['CompanyRecord']['email'] . ">");
$result = $mail->send(array($RecurrOrderRow['email']));
unset($mail);
} else {
prnMsg(_('No email advice was sent for this order because the location has no email contact defined with a valid email address'), 'warn');
}
}
/*end while there are recurring orders due to have a new order created */
include 'includes/footer.inc';
示例11: htmlMimeMail
$result = DB_query($sql, $db);
}
$mail = new htmlMimeMail();
$mail->setSubject(_('Your offer to') . ' ' . $_SESSION['CompanyRecord']['coyname'] . ' ' . _('has been accepted'));
$mail->setText($MailText);
$mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>');
$result = $mail->send(array($Email), 'smtp');
prnMsg(_('The accepted offers from') . ' ' . $SupplierName . ' ' . _('have been converted to purchase orders and an email sent to') . ' ' . $Email . "\n" . _('Please review the order contents') . ' ' . '<a href="' . $rootpath . '/PO_Header.php?&ModifyOrderNumber=' . $OrderNo . '">' . _('here') . '</a>', 'success');
}
if (sizeOf($rejects) > 0) {
$MailText = _('This email has been automatically generated by the webERP installation at') . ' ' . $_SESSION['CompanyRecord']['coyname'] . "\n";
$MailText .= _('The following offers you made have been rejected') . "\n\n";
foreach ($rejects as $RejectID) {
$sql = "SELECT offers.quantity,\n\t\t\t\t\t\t\toffers.price,\n\t\t\t\t\t\t\tstockmaster.description\n\t\t\t\t\t\tFROM offers\n\t\t\t\t\t\tLEFT JOIN stockmaster\n\t\t\t\t\t\t\tON offers.stockid=stockmaster.stockid\n\t\t\t\t\t\tWHERE offerid='" . $RejectID . "'";
$result = DB_query($sql, $db);
$myrow = DB_fetch_array($result);
$MailText .= $myrow['description'] . "\t" . _('Quantity') . ' ' . $myrow['quantity'] . "\t" . _('Price') . ' ' . number_Format($myrow['price']) . "\n";
$sql = "DELETE FROM offers WHERE offerid='" . $RejectID . "'";
$result = DB_query($sql, $db);
}
$mail = new htmlMimeMail();
$mail->setSubject(_('Your offer to') . ' ' . $_SESSION['CompanyRecord']['coyname'] . ' ' . _('has been rejected'));
$mail->setText($MailText);
$mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>');
$result = $mail->send(array($Email), 'smtp');
prnMsg(_('The rejected offers from') . ' ' . $SupplierName . ' ' . _('have been removed from the system and an email sent to') . ' ' . $Email, 'success');
}
prnMsg(_('All offers have been processed, and emails sent where appropriate'), 'success');
}
}
include 'includes/footer.inc';
示例12: date
}
if ($_SESSION['SalesmanLogin'] != '') {
$sql .= " AND debtortrans.salesperson='" . $_SESSION['SalesmanLogin'] . "'";
}
$ErrMsg = _('Could not retrieve the count of sales order lines in the period under review');
$result = DB_query($sql, $db, $ErrMsg);
$myrow = DB_fetch_row($result);
$YPos -= $line_height;
$LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 200, $FontSize, _('Total number of order lines') . ' ' . locale_number_format($myrow[0]), 'left');
$YPos -= $line_height;
$LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 200, $FontSize, _('DIFOT') . ' ' . locale_number_format((1 - $TotalDiffs / $myrow[0]) * 100, 2) . '%', 'left');
$ReportFileName = $_SESSION['DatabaseName'] . '_DeliveryDifferences_' . date('Y-m-d') . '.pdf';
$pdf->OutputD($ReportFileName);
if ($_POST['Email'] == 'Yes') {
if (file_exists($_SESSION['reports_dir'] . '/' . $ReportFileName)) {
unlink($_SESSION['reports_dir'] . '/' . $ReportFileName);
}
$pdf->Output($_SESSION['reports_dir'] . '/' . $ReportFileName, 'F');
include 'includes/htmlMimeMail.php';
$mail = new htmlMimeMail();
$attachment = $mail->getFile($_SESSION['reports_dir'] . '/' . $ReportFileName);
$mail->setText(_('Please find herewith delivery differences report from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']);
$mail->addAttachment($attachment, $ReportFileName, 'application/pdf');
if ($_SESSION['SmtpSetting'] == 0) {
$mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>');
$result = $mail->send(array($_SESSION['FactoryManagerEmail']));
} else {
$result = SendmailBySmtp($mail, array($_SESSION['FactoryManagerEmail']));
}
}
$pdf->__destruct();
示例13: htmlMimeMail
$YPos -= 2 * $line_height;
}
$YPos -= 2 * $line_height;
/*Print out the grand totals */
$LeftOvers = $pdf->addTextWrap(80, $YPos, 260 - $Left_Margin, $FontSize, _('Grand Total Value'), 'right');
$DisplayTotalVal = locale_money_format($Tot_Val, $_SESSION['CompanyRecord']['currencydefault']);
$LeftOvers = $pdf->addTextWrap(500, $YPos, 60, $FontSize, $DisplayTotalVal, 'right');
if ($_POST['DetailedReport'] == 'Yes') {
$pdf->line($Left_Margin, $YPos + $line_height - 2, $Page_Width - $Right_Margin, $YPos + $line_height - 2);
$YPos -= 2 * $line_height;
}
if ($ListCount == 0) {
$title = _('Print Inventory Valuation Error');
include 'includes/header.inc';
echo '<br />' . _('There were no items with any value to print out for the location specified');
echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>';
include 'includes/footer.inc';
exit;
// Javier: needs check
} else {
include 'includes/htmlMimeMail.php';
$pdf->Output($_SESSION['reports_dir'] . '/InventoryReport.pdf', 'F');
$pdf->__destruct();
$mail = new htmlMimeMail();
$attachment = $mail->getFile($_SESSION['reports_dir'] . '/InventoryReport.pdf');
$mail->setText(_('Please find herewith the stock valuation report'));
$mail->setSubject(_('Inventory Valuation Report'));
$mail->addAttachment($attachment, 'InventoryReport.pdf', 'application/pdf');
$mail->setFrom($_SESSION['CompanyRecord']['coyname'] . "<" . $_SESSION['CompanyRecord']['email'] . ">");
$result = $mail->send($Recipients);
}
示例14: class
* (case-sensitive) to the name in the html.
*/
$mail->setHtml($html, $text);
$mail->addHtmlImage($background, 'background.gif', 'image/gif');
/*
* This is used to add an attachment to
* the email. Due to above, the $attachment
* variable contains the example zip file.
*/
$mail->addAttachment($attachment, 'example.zip', 'application/zip');
/*
* Set the return path of the message
*/
$mail->setReturnPath('joe@example.com');
/**
* Set some headers
*/
$mail->setFrom('"Joe" <joe@example.com>');
$mail->setSubject('Test mail');
$mail->setHeader('X-Mailer', 'HTML Mime mail class (http://www.phpguru.org)');
/**
* Send it using SMTP. If you're using Windows you should *always* use
* the smtp method of sending, as the mail() function is buggy.
*/
$result = $mail->send(array('postmaster@localhost'), 'smtp');
// These errors are only set if you're using SMTP to send the message
if (!$result) {
print_r($mail->errors);
} else {
echo 'Mail sent!';
}
示例15: 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;
}
}