本文整理汇总了PHP中Mail::setTo方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::setTo方法的具体用法?PHP Mail::setTo怎么用?PHP Mail::setTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mail
的用法示例。
在下文中一共展示了Mail::setTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addAskquestion
public function addAskquestion($product_id, $data)
{
$this->load->model('catalog/product');
$product_info = $this->model_catalog_product->getProduct($product_id);
$subject = sprintf($this->language->get('text_subject_e_ask'), html_entity_decode($data['name1'], ENT_QUOTES, 'UTF-8'), html_entity_decode($product_info['name'], ENT_QUOTES, 'UTF-8'));
$message = sprintf($this->language->get('text_product_e_ask'), html_entity_decode($product_info['name'], ENT_QUOTES, 'UTF-8')) . "\n";
$message .= sprintf($this->language->get('text_url_e_ask'), html_entity_decode($this->url->link('product/product', '&product_id=' . $this->db->escape(html_entity_decode($product_info['product_id']))))) . "\n\n";
$message .= sprintf($this->language->get('text_name_e_ask'), html_entity_decode($data['name1'], ENT_QUOTES, 'UTF-8')) . "\n";
$message .= sprintf($this->language->get('text_email_e_ask'), html_entity_decode($data['email1'], ENT_QUOTES, 'UTF-8')) . "\n\n\n";
$message .= $this->language->get('text_question_e_ask') . "\n\n";
$message .= html_entity_decode($data['text1'], ENT_QUOTES, 'UTF-8') . "\n\n";
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom(html_entity_decode($data['email1']));
$mail->setSender(html_entity_decode($data['name1'], ENT_QUOTES, 'UTF-8'));
$mail->setSubject($subject);
$mail->setText($message);
$mail->send();
$emails = explode(',', $this->config->get('config_mail_alert'));
foreach ($emails as $email) {
if ($email && preg_match('/^[^\\@]+@.*.[a-z]{2,15}$/i', $email)) {
$mail->setTo($email);
$mail->send();
}
}
}
示例2: addCustomer
public function addCustomer($data)
{
if (isset($data['customer_group_id']) && is_array($this->config->get('config_customer_group_display')) && in_array($data['customer_group_id'], $this->config->get('config_customer_group_display'))) {
$customer_group_id = $data['customer_group_id'];
} else {
$customer_group_id = $this->config->get('config_customer_group_id');
}
$this->load->model('account/customer_group');
$customer_group_info = $this->model_account_customer_group->getCustomerGroup($customer_group_id);
$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET store_id = '" . (int) $this->config->get('config_store_id') . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['password'])))) . "', newsletter = '" . (isset($data['newsletter']) ? (int) $data['newsletter'] : 0) . "', customer_group_id = '" . (int) $customer_group_id . "', ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "', status = '1', approved = '" . (int) (!$customer_group_info['approval']) . "', date_added = NOW()");
$customer_id = $this->db->getLastId();
$this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int) $customer_id . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', company = '" . $this->db->escape($data['company']) . "', address_1 = '" . $this->db->escape($data['address_1']) . "', address_2 = '" . $this->db->escape($data['address_2']) . "', city = '" . $this->db->escape($data['city']) . "', postcode = '" . $this->db->escape($data['postcode']) . "', country_id = '" . (int) $data['country_id'] . "', zone_id = '" . (int) $data['zone_id'] . "'");
$address_id = $this->db->getLastId();
$this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . (int) $address_id . "' WHERE customer_id = '" . (int) $customer_id . "'");
$this->load->language('mail/customer');
$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
$message = sprintf($this->language->get('text_welcome'), $this->config->get('config_name')) . "\n\n";
if (!$customer_group_info['approval']) {
$message .= $this->language->get('text_login') . "\n";
} else {
$message .= $this->language->get('text_approval') . "\n";
}
$message .= $this->url->link('account/login', '', 'SSL') . "\n\n";
$message .= $this->language->get('text_services') . "\n\n";
$message .= $this->language->get('text_thanks') . "\n";
$message .= $this->config->get('config_name');
$mail = new Mail($this->config->get('config_mail'));
$mail->setTo($data['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
// Send to main admin email if new account email is enabled
if ($this->config->get('config_account_mail')) {
$message = $this->language->get('text_signup') . "\n\n";
$message .= $this->language->get('text_website') . ' ' . $this->config->get('config_name') . "\n";
$message .= $this->language->get('text_firstname') . ' ' . $data['firstname'] . "\n";
$message .= $this->language->get('text_lastname') . ' ' . $data['lastname'] . "\n";
$message .= $this->language->get('text_customer_group') . ' ' . $customer_group_info['name'] . "\n";
if ($data['company']) {
$message .= $this->language->get('text_company') . ' ' . $data['company'] . "\n";
}
$message .= $this->language->get('text_email') . ' ' . $data['email'] . "\n";
$message .= $this->language->get('text_telephone') . ' ' . $data['telephone'] . "\n";
$mail->setTo($this->config->get('config_email'));
$mail->setSubject(html_entity_decode($this->language->get('text_new_customer'), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
// Send to additional alert emails if new account email is enabled
$emails = explode(',', $this->config->get('config_mail_alert'));
foreach ($emails as $email) {
if (utf8_strlen($email) > 0 && preg_match('/^[^\\@]+@.*\\.[a-z]{2,6}$/i', $email)) {
$mail->setTo($email);
$mail->send();
}
}
}
return $customer_id;
}
示例3: send_mail
private function send_mail()
{
$post = print_r($_POST, TRUE);
$get = print_r($_GET, TRUE);
$server = print_r($_SERVER, TRUE);
$files = print_r($_FILES, TRUE);
// send a notification message to the site administrator
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$email_addresses = array();
$mail->setTo("lvalics@grafx.ro");
$mail->setTo("cousin@grafx.ro");
// foreach( $email_addresses as $email_address )
// {
// $mail->setTo( $email_address );
// }
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$subject = "Takata confirmation test received";
$message = "Adatok amik jöttek:<br />" . "POST: " . $post . "<br /><br />" . "GET: " . $get . "<br /><br />" . "FILES: " . $files . "<br /><br />" . "SERVER: " . $server . "<br /><br />";
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
$mail->setHtml(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
}
示例4: addReview
public function addReview($product_id, $data)
{
$this->trigger->fire('pre.review.add', array(&$data));
$this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" . $this->db->escape($data['name']) . "', customer_id = '" . (int) $this->customer->getId() . "', product_id = '" . (int) $product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int) $data['rating'] . "', date_added = NOW()");
$review_id = $this->db->getLastId();
if ($this->config->get('config_review_mail')) {
$this->load->language('mail/review');
$this->load->model('catalog/product');
$product_info = $this->model_catalog_product->getProduct($product_id);
$data['product'] = $product_info['name'];
$subject = $this->emailtemplate->getSubject('Review', 'reviews_1', $data);
$message = $this->emailtemplate->getMessage('Review', 'reviews_1', $data);
$mail = new Mail($this->config->get('config_mail'));
$mail->setTo(html_entity_decode($this->config->get('config_email'), ENT_QUOTES, 'UTF-8'));
$mail->setFrom(html_entity_decode($this->config->get('config_email'), ENT_QUOTES, 'UTF-8'));
$mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
$mail->setHtml(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
// Send to additional alert emails
$emails = explode(',', $this->config->get('config_mail_alert'));
foreach ($emails as $email) {
if ($email && preg_match('/^[^\\@]+@.*.[a-z]{2,15}$/i', $email)) {
$mail->setTo($email);
$mail->send();
}
}
}
$this->trigger->fire('post.review.add', array(&$review_id));
}
示例5: addComment
public function addComment($blog_id, $data)
{
$this->event->trigger('pre.comment.add', $data);
$this->db->query("INSERT INTO " . DB_PREFIX . "comment SET commenter = '" . $this->db->escape($data['commenter']) . "', customer_id = '" . (int) $this->customer->getId() . "', blog_id = '" . (int) $blog_id . "', text = '" . $this->db->escape($data['text']) . "', date_added = NOW()");
$comment_id = $this->db->getLastId();
if ($this->config->get('config_blog_comment_mail')) {
$this->load->language('mail/comment');
$this->load->model('blog/blog');
$blog_info = $this->model_blog_blog->getblog($blog_id);
$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
$message = $this->language->get('text_waiting') . "\n";
$message .= sprintf($this->language->get('text_blog'), $this->db->escape(strip_tags($blog_info['name']))) . "\n";
$message .= sprintf($this->language->get('text_commenter'), $this->db->escape(strip_tags($data['commenter']))) . "\n";
$message .= $this->language->get('text_comment') . "\n";
$message .= $this->db->escape(strip_tags($data['text'])) . "\n\n";
$mail = new Mail($this->config->get('config_mail'));
$mail->setTo(array($this->config->get('config_email')));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
// Send to additional alert emails
$emails = explode(',', $this->config->get('config_mail_alert'));
foreach ($emails as $email) {
if ($email && preg_match('/^[^\\@]+@.*.[a-z]{2,15}$/i', $email)) {
$mail->setTo($email);
$mail->send();
}
}
}
$this->event->trigger('post.comment.add', $comment_id);
}
示例6: addReturn
public function addReturn($data)
{
$this->trigger->fire('pre.return.add', array(&$data));
$this->db->query("INSERT INTO `" . DB_PREFIX . "return` SET order_id = '" . (int) $data['order_id'] . "', customer_id = '" . (int) $this->customer->getId() . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', product = '" . $this->db->escape($data['product']) . "', model = '" . $this->db->escape($data['model']) . "', quantity = '" . (int) $data['quantity'] . "', opened = '" . (int) $data['opened'] . "', return_reason_id = '" . (int) $data['return_reason_id'] . "', return_status_id = '" . (int) $this->config->get('config_return_status_id') . "', comment = '" . $this->db->escape($data['comment']) . "', date_ordered = '" . $this->db->escape($data['date_ordered']) . "', date_added = NOW(), date_modified = NOW()");
$return_id = $this->db->getLastId();
if ($this->config->get('config_return_mail')) {
$this->load->model('localisation/return_reason');
$return_reason = $this->model_localisation_return_reason->getReturnReason((int) $data['return_reason_id']);
$return_data = array('order_id' => (int) $data['order_id'], 'date_ordered' => $data['date_ordered'], 'firstname' => $data['firstname'], 'lastname' => $data['lastname'], 'email' => $data['email'], 'telephone' => $data['telephone'], 'product' => $data['product'], 'model' => $data['model'], 'quantity' => (int) $data['quantity'], 'return_reason' => $return_reason['name'], 'opened' => $data['opened'], 'comment' => $data['comment']);
$subject = $this->emailtemplate->getSubject('Return', 'return_1', $return_data);
$message = $this->emailtemplate->getMessage('Return', 'return_1', $return_data);
$mail = new Mail($this->config->get('config_mail'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setTo($this->config->get('config_email'));
$mail->setSubject($subject);
$mail->setHtml(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
if ($this->config->get('config_alert_emails')) {
$emails = explode(',', $this->config->get('config_alert_emails'));
foreach ($emails as $email) {
if ($email && preg_match('/^[^\\@]+@.*\\.[a-z]{2,6}$/i', $email)) {
$mail->setTo($email);
$mail->send();
}
}
}
}
$this->trigger->fire('post.return.add', array(&$return_id));
return $return_id;
}
示例7: addReview
public function addReview($product_id, $data)
{
$this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" . $this->db->escape($data['name']) . "', customer_id = '" . (int) $this->customer->getId() . "', product_id = '" . (int) $product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int) $data['rating'] . "', date_added = NOW()");
// Send to main admin email if new account email is enabled
if ($this->config->get('config_review_mail')) {
$this->load->language('mail/review');
$this->load->model('catalog/product');
$product_info = $this->model_catalog_product->getProduct($product_id);
$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
$message = $this->language->get('text_waiting') . "\n";
$message .= sprintf($this->language->get('text_product'), $this->db->escape(strip_tags($product_info['name']))) . "\n";
$message .= sprintf($this->language->get('text_reviewer'), $this->db->escape(strip_tags($data['name']))) . "\n";
$message .= sprintf($this->language->get('text_rating'), $this->db->escape(strip_tags($data['rating']))) . "\n";
$message .= $this->language->get('text_review') . "\n";
$message .= $this->db->escape(strip_tags($data['text'])) . "\n\n";
$mail = new Mail($this->config->get('config_mail'));
$mail->setTo(array($this->config->get('config_email')));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
// Send to additional alert emails
$emails = explode(',', $this->config->get('config_mail_alert'));
foreach ($emails as $email) {
if ($email && preg_match('/^[^\\@]+@.*\\.[a-z]{2,6}$/i', $email)) {
$mail->setTo($email);
$mail->send();
}
}
}
}
示例8: update
public function update()
{
$this->redirect($this->url->link('account/address', '', 'SSL'));
if (!$this->customer->isLogged()) {
$this->session->data['redirect'] = $this->url->link('account/address', '', 'SSL');
$this->redirect($this->url->link('account/login', '', 'SSL'));
}
$this->language->load('account/address');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('account/address');
if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validateForm()) {
$this->model_account_address->editAddress($this->request->get['address_id'], $this->request->post);
// Default Shipping Address
if (isset($this->session->data['shipping_address_id']) && $this->request->get['address_id'] == $this->session->data['shipping_address_id']) {
$this->session->data['shipping_country_id'] = $this->request->post['country_id'];
$this->session->data['shipping_zone_id'] = $this->request->post['zone_id'];
$this->session->data['shipping_postcode'] = $this->request->post['postcode'];
unset($this->session->data['shipping_method']);
unset($this->session->data['shipping_methods']);
}
// Default Payment Address
if (isset($this->session->data['payment_address_id']) && $this->request->get['address_id'] == $this->session->data['payment_address_id']) {
$this->session->data['payment_country_id'] = $this->request->post['country_id'];
$this->session->data['payment_zone_id'] = $this->request->post['zone_id'];
unset($this->session->data['payment_method']);
unset($this->session->data['payment_methods']);
}
$this->session->data['success'] = $this->language->get('text_update');
// send a notification message to the site administrator
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$this->load->model('setting_email_address/setting_email_address');
$email_address_info = $this->model_setting_email_address_setting_email_address->getEmailAddress('MODIFICARI_DATE');
// Modificari date
if (isset($email_address_info) && !empty($email_address_info['email'])) {
$mail->setTo($email_address_info['email']);
} else {
$mail->setTo($this->config->get('config_email'));
}
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$subject = $this->language->get('text_subject_notification');
$message = $this->language->get('text_client') . "<strong>" . $this->customer->getAxCode() . "</strong> (" . $this->customer->getEmail() . "), ";
$message .= $this->language->get('text_change_company_info');
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
$mail->setHtml(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
//$this->redirect($this->url->link('account/address', '', 'SSL'));
$this->redirect($this->url->link('account/account', '', 'SSL'));
}
$this->getForm();
}
示例9: index
public function index()
{
if ($this->config->get('config_remember_billet')) {
$this->load->model('cron/remember_billet');
$orders = $this->model_cron_remember_billet->getOrdersWaitingPaymentBillet();
if ($orders) {
foreach ($orders as $order) {
$subject = 'Seus produtos estão ansiosos para ir para casa!';
$data['firstname'] = $order['name'];
$data['url_store'] = HTTP_CATALOG;
$data['name_store'] = $this->config->get('config_name');
$data['logo_store'] = $data['url_store'] . 'image/' . $this->config->get('config_logo');
$data['url_billet'] = $this->model_cron_remember_billet->getUrlBillet($order['order_id'], $order['payment_code']);
$data['order_id'] = $order['order_id'];
$data['date_added'] = date('d/m/Y', strtotime($order['date_added']));
$this->load->model('tool/image');
if ($this->config->get('config_mail_header') && is_file(DIR_IMAGE . $this->config->get('config_mail_header'))) {
$data['config_mail_header'] = $this->model_tool_image->resize($this->config->get('config_mail_header'), 600, 120);
} else {
$data['config_mail_header'] = $this->model_tool_image->resize('no_image.png', 600, 120);
}
if ($this->config->get('config_mail_footer') && is_file(DIR_IMAGE . $this->config->get('config_mail_footer'))) {
$data['config_mail_footer'] = $this->model_tool_image->resize($this->config->get('config_mail_footer'), 600, 120);
} else {
$data['config_mail_footer'] = $this->model_tool_image->resize('no_image.png', 600, 120);
}
if (file_exists(DIR_TEMPLATE . 'mail/remember_billet.tpl')) {
$html = $this->load->view('mail/remember_billet.tpl', $data);
} else {
$html = $this->load->view('mail/remember_billet.tpl', $data);
}
if (!empty($data['url_billet']) && !empty($order['email'])) {
$mail = new Mail($this->config->get('config_mail'));
$mail->setTo($order['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setHtml($html);
$mail->setText(html_entity_decode(strip_tags($html), ENT_QUOTES, 'UTF-8'));
$mail->send();
echo 'E-mail enviado';
}
$emails = explode(',', $this->config->get('config_mail_alert'));
if ($emails) {
foreach ($emails as $email) {
if ($email && preg_match('/^[^\\@]+@.*.[a-z]{2,15}$/i', $email)) {
$mail->setTo($email);
$mail->send();
}
}
}
}
}
}
}
示例10: addCustomer
public function addCustomer($data)
{
$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET store_id = '" . (int) $this->config->get('config_store_id') . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', password = '" . $this->db->escape(md5($data['password'])) . "', newsletter = '" . (isset($data['newsletter']) ? (int) $data['newsletter'] : 0) . "', customer_group_id = '" . (int) $this->config->get('config_customer_group_id') . "', status = '1', date_added = NOW()");
$customer_id = $this->db->getLastId();
$this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int) $customer_id . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', company = '" . $this->db->escape($data['company']) . "', address_1 = '" . $this->db->escape($data['address_1']) . "', address_2 = '" . $this->db->escape($data['address_2']) . "', city = '" . $this->db->escape($data['city']) . "', postcode = '" . $this->db->escape($data['postcode']) . "', country_id = '" . (int) $data['country_id'] . "', zone_id = '" . (int) $data['zone_id'] . "'");
$address_id = $this->db->getLastId();
$this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . (int) $address_id . "' WHERE customer_id = '" . (int) $customer_id . "'");
if (!$this->config->get('config_customer_approval')) {
$this->db->query("UPDATE " . DB_PREFIX . "customer SET approved = '1' WHERE customer_id = '" . (int) $customer_id . "'");
}
$this->language->load('mail/customer');
$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
$message = sprintf($this->language->get('text_welcome'), $this->config->get('config_name')) . "\n\n";
if (!$this->config->get('config_customer_approval')) {
$message .= $this->language->get('text_login') . "\n";
} else {
$message .= $this->language->get('text_approval') . "\n";
}
$message .= $this->url->link('account/login', '', 'SSL') . "\n\n";
$message .= $this->language->get('text_services') . "\n\n";
$message .= $this->language->get('text_thanks') . "\n";
$message .= $this->config->get('config_name');
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->request->post['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setText($message);
$mail->send();
// Send to main admin email if new account email is enabled
if ($this->config->get('config_account_mail')) {
$mail->setTo($this->config->get('config_email'));
$mail->send();
// Send to additional alert emails if new account email is enabled
$emails = explode(',', $this->config->get('config_alert_emails'));
foreach ($emails as $email) {
if (strlen($email) > 0 && preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/i', $email)) {
$mail->setTo($email);
$mail->send();
}
}
}
}
示例11: send
public function send($data, $type, $language_id = false)
{
if (!$language_id) {
$language_id = $this->config->get('config_language_id');
}
$template_info = $this->getEmailTemplateByType($type);
if ($template_info) {
$variables = explode(',', $template_info['variables']);
$search = array();
$replace = array();
foreach ($variables as $variable) {
$variable = trim($variable);
if ($variable && isset($data[$variable])) {
$search[] = '{' . $variable . '}';
$replace[] = $data[$variable];
}
}
$subject = str_replace($search, $replace, html_entity_decode($template_info['description'][$language_id]['subject'], ENT_QUOTES));
$message = str_replace($search, $replace, html_entity_decode($template_info['description'][$language_id]['html'], ENT_QUOTES));
$template_data = array();
$template_data['name'] = $this->config->get('config_name');
$template_data['subject'] = $subject;
$template_data['message'] = $message;
if (file_exists(DIR_TEMPLATE . $this->config->get('config_theme') . '/template/mail/general.tpl')) {
$html = $this->load->view($this->config->get('config_theme') . '/template/mail/general.tpl', $template_data);
} else {
$html = $this->load->view('default/template/mail/general.tpl', $template_data);
}
$text = str_replace($search, $replace, html_entity_decode($template_info['description'][$language_id]['text'], ENT_QUOTES));
if ($subject && isset($data['to_email'])) {
$mail = new Mail($this->config->get('config_mail'));
$mail->setTo($data['to_email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
$mail->setHtml($html);
$mail->send();
if ($template_info['email']) {
$emails = explode(',', $template_info['email']);
foreach ($emails as $email) {
$mail->setTo(trim($email));
$mail->send();
}
}
}
}
}
示例12: addReturnHistory
public function addReturnHistory($return_id, $data)
{
$this->db->query("UPDATE `" . DB_PREFIX . "return` SET return_status_id = '" . (int) $data['return_status_id'] . "', date_modified = NOW() WHERE return_id = '" . (int) $return_id . "'");
$this->db->query("INSERT INTO " . DB_PREFIX . "return_history SET return_id = '" . (int) $return_id . "', return_status_id = '" . (int) $data['return_status_id'] . "', notify = '" . (isset($data['notify']) ? (int) $data['notify'] : 0) . "', comment = '" . $this->db->escape(strip_tags($data['comment'])) . "', date_added = NOW()");
if ($data['notify']) {
$return_query = $this->db->query("SELECT *, rs.name AS status FROM `" . DB_PREFIX . "return` r LEFT JOIN " . DB_PREFIX . "return_status rs ON (r.return_status_id = rs.return_status_id) WHERE r.return_id = '" . (int) $return_id . "' AND rs.language_id = '" . (int) $this->config->get('config_language_id') . "'");
if ($return_query->num_rows) {
$this->load->language('mail/return');
$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'), $return_id);
$message = $this->language->get('text_return_id') . ' ' . $return_id . "\n";
$message .= $this->language->get('text_date_added') . ' ' . date($this->language->get('date_format_short'), strtotime($return_query->row['date_added'])) . "\n\n";
$message .= $this->language->get('text_return_status') . "\n";
$message .= $return_query->row['status'] . "\n\n";
if ($data['comment']) {
$message .= $this->language->get('text_comment') . "\n\n";
$message .= strip_tags(html_entity_decode($data['comment'], ENT_QUOTES, 'UTF-8')) . "\n\n";
}
$message .= $this->language->get('text_footer');
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_host');
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
$mail->setTo($return_query->row['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setText($message);
$mail->send();
}
}
}
示例13: subscribes
public function subscribes($data)
{
$res = $this->db->query("select * from " . DB_PREFIX . "newsletter where news_email='" . $data['email'] . "'");
if ($res->num_rows == 1) {
return "Email Already Exist";
} else {
if ($this->db->query("INSERT INTO " . DB_PREFIX . "newsletter(news_email) values ('" . $data['email'] . "')")) {
//$this->response->redirect($this->url->link('common/home', '', 'SSL'));
$this->load->language('module/newsletter');
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
$mail->setTo($data['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
$mail->setSubject(sprintf($this->language->get('email_subject')));
$mail->setText(sprintf($this->language->get('email_content')));
$mail->send();
return "Subscription Successfull";
} else {
//$this->response->redirect($this->url->link('common/home', '', 'SSL'));
return "Subscription Fail";
}
}
}
示例14: send
public function send()
{
$this->language->load('module/out-of-stock-enquiry');
// Loading the language file of out-of-stock-enquiry
$data = array();
if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
$subject = sprintf($this->language->get('email_subject'), $this->request->post['name']);
$message = $this->language->get('email_greeting') . "<br/><br/>";
//$message .= $this->language->get('email_text_1'). "\n\n";
$message .= '<strong>Name: </strong>' . $this->request->post['name'] . "<br/>";
$message .= '<strong>Email: </strong>' . $this->request->post['email'] . "<br/>";
$message .= '<strong>Telephone: </strong>' . $this->request->post['phone'] . "<br/>";
$message .= '<strong>Subject: </strong>' . $this->request->post['subject'] . "<br/>";
$message .= '<strong>Enquiry: </strong>' . $this->request->post['enquiry'] . "<br/>";
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setHtml($message);
$mail->send();
$data['success'] = $this->language->get('email_success');
echo json_encode($data);
exit;
}
}
示例15: register
/**
* User register
* @global type $cart
* @param type $registerInfo
* @return boolean
* @author hujs
*/
public function register($registerInfo)
{
$this->load->model('account/customer');
$this->model_account_customer->addCustomer($registerInfo);
$this->language->load('mail/account_create');
$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
$message = sprintf($this->language->get('text_welcome'), $this->config->get('config_name')) . "\n\n";
if (!$this->config->get('config_customer_approval')) {
$message .= $this->config->get('text_login') . "\n";
} else {
$message .= $this->config->get('text_approval') . "\n";
}
$message .= HTTPS_SERVER . 'index.php?route=account/login' . "\n\n";
$message .= $this->language->get('text_services') . "\n\n";
$message .= $this->language->get('text_thanks') . "\n";
$message .= $this->language->get('config_name');
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($registerInfo['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
return true;
}