A5下载 - 努力做内容最丰富最安全的下载站!

A5站长下载站

当前位置:A5下载 > 源码技巧 > Ecshop > ecshop绕过禁用SMTP发送邮件

ecshop绕过禁用SMTP发送邮件

时间:2015-07-09 08:54作者:fang人气:86

现在很多服务器商都会由于禁用SMTP,防止用户滥发邮件,让系统更稳定。 这里如果禁用,采用如下修改方法即可解决问题,

在ecshop种修改lib_base.php

将此函数原有的内容注释掉,用下面的方法进行替换.即可绕过服务器使用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'

)//www.zuimoban.com

),

'headers' => array('Reply-To' => 'calvin@moke8.com')

);

//$async = false;

//$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 are 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,绕过,禁用,SMTP,发送,邮件,现在,很多

相关下载

查看所有评论+

网友评论

网友
您的评论需要经过审核才能显示

公众号