ecshop群发邮件修改:
找到文件includes/lib_base.php
修改方法send_mail:
将这一句
$headers[] = 'To: "' . '=?' . $charset . '?B?' . base64_encode($name) . '?=' . '" <' . $email. '>';
修改成:
//adophper 更新群发邮件
$email = str_replace(';', ',', $email);
if (strpos($email, ',')){
$emailArray = explode(',', $email);
$string = "";
foreach ($emailArray as $key => $item){
$length = strpos($item, '@');
$string .= ($key == 0 ? base64_encode(substr($item, 0, $length)).'?=' : substr($item, 0, $length) ).'<' . $item. '>,';
}
$string = rtrim($string, ',');
$headers[] = 'To: "' . '=?' . $charset . '?B?"' . $string;
}else{
$headers[] = 'To: "' . '=?' . $charset . '?B?' . base64_encode($name) . '?=' . '"<' . $email. '>';
}
然后下面在
$send_params['recipients'] = $email;
前面加上数组。
//adophper 更新群发邮件
if (strpos($email, ',')){
$email = explode(',', $email);
}
$send_params['recipients'] = $email;
上面我们已经把";"修改成了",",在后台使用中如何多个邮件就可以用";"或者","分隔不同的人可能有不同的习惯。