Ecshop use third-party WEBAPI to send mail

Source: Internet
Author: User

Since SMTP was disabled by the server vendor, all of the e-mail agents were found online. http://www.mandrill.com/

Modify lib_base.php

Comment out the original contents of this function and replace it with the following method. You can bypass the server to send mail using 80.

function Send_mail ($name, $email, $subject, $content, $type = 0, $notification =false) {

Include_once (Root_path. ' includes/mandrill/mandrill.php ');

try {
 
$mandrill = new Mandrill ($GLOBALS [' _cfg '] [' smtp_pass ']);
$message = Array (
' text ' = ') ,
' html ' = $content,
' subject ' + $subject,
' from_email ' = ' $GLOBALS [' _cfg '] [' smtp_mail '],
' From_name ' + $shop _name,
' to ' = = Array (
Array (
' email ' = ' $email,
' name ' = = $name,
' type ' = ' to '
)
),
' headers ' = = Array (' reply-to ' = ' = ' [email protected] ')

);
//$async = FA Lse
//$ip _pool = ' Main pool ';
//$send _at = ' 2015-05-05 16:56:01 ';
$result = $mandrill->messages->send ($message);
return true;
//print_r ($result);
} catch (Mandrill_error $e) {
//Mandrill Errors is thrown as exceptions
Echo ' A mandrill Error occurred: '. Get_class ($e). ‘ - ‘ . $e->getmessage ();
//A Mandrill error occurred:mandrill_unknown_subaccount-no Subaccount exists with the id ' customer-123 '
Throw $e;
}

Ecshop use third-party WEBAPI to send mail

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.