function sendMail1($sTo, $sFrom, $sSubject, $mMail) { $mail = new PHPMailer1(true); $mail->IsMail(); $mail->IsHTML(true); $mail->CharSet = "utf-8"; try { $mail->AddReplyTo($sTo); $mail->AddAddress($sTo); $mail->SetFrom($sFrom); $mail->Subject = $sSubject; $mail->MsgHTML($mMail); $mail->Send(); } catch (phpmailerException $e) { $sErrorMsg = $e->errorMessage(); } catch (Exception $e) { $sErrorMsg .= $e->getMessage(); } return true; }
// SMTP account username $mail->Password = "******"; // SMTP account password $mail->SetFrom('*****@*****.**', 'First Last'); $mail->AddReplyTo("*****@*****.**", "First Last"); $mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication"; $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail->MsgHTML($body); $address = "*****@*****.**"; $mail->AddAddress($address, "John Doe"); $mail->AddAttachment("images/phpmailer.gif"); // attachment $mail->AddAttachment("images/phpmailer_mini.gif"); // attachment if (!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } $view->display('/views/products/autocomplete.tpl'); } elseif ($mode == 'ajax_search') { //ini_set('display_errors', 2); //var_dump($_GET['q']); $key = mysql_real_escape_string($_GET['q']); $result = array(); $product_id_row = db_get_fields("SELECT product_id, MATCH(product) AGAINST ('{$key}' IN BOOLEAN MODE) AS relevance FROM `cscart_product_descriptions` WHERE MATCH(product) AGAINST ('{$key}' IN BOOLEAN MODE) AND `lang_code` = 'RU' ORDER BY relevance DESC LIMIT 8"); foreach ($product_id_row as $product) { $product_name = fn_get_product_name($product); $product_amount = db_get_fields("SELECT amount, list_price FROM cscart_products WHERE `product_id` = {$product}"); if ($product_amount[0] > 0) {