1.打开 ripro->inc->codestar-framework->options->options.theme.php文件
2.查找“SMTP设置”,修改如图红框所示位置
3.修改后代码展示:
array(
'id' => 'mail_address',
'type' => 'text',
'title' => '发信邮箱',
'subtitle' => '请填写发件人邮箱帐号',
'default' => '88888888@qq.com',
'validate' => 'csf_validate_email',
),
array(
'id' => 'mail_name',
'type' => 'text',
'title' => '发信人名称',
'subtitle' => '请填写发件人名称',
),
4.打开 ripro->inc->core-functions.php 文件,查找“mail_name”,修改“$mail_username = _cao(‘mail_name’);”为“$mail_username = _cao(‘mail_address’);”
修改后代码(不展示效果,可自行测试)
/**
{:301_978:}修改后请记得保存哦,然后进入站点后台主题设置->SMTP设置,重置当前分区,设置并保存即可
{:301_1010:}心动了吗,心动了还不赶快去试试
* [mail_smtp SMTP集成]
* [url=home.php?mod=space&uid=686208]@AuThor[/url] Dadong2g
* @DateTime 2019-05-28T12:30:03+0800
* [url=home.php?mod=space&uid=952169]@Param[/url] [type] $phpmailer [description]
* [url=home.php?mod=space&uid=155549]@Return[/url] [type] [description]
*/
function mail_smtp($phpmailer)
{
if (_cao('mail_smtps',true)) {
$phpmailer->IsSMTP();
$mail_name = _cao('mail_name');
$mail_host = _cao('mail_host');
$mail_port = _cao('mail_port');
$mail_username = _cao('mail_address');
$mail_passwd = _cao('mail_passwd');
$mail_smtpsecure = _cao('mail_smtpsecure');
$phpmailer->FromName = $mail_name ? $mail_name : 'caozhuti';//发件人名称
$phpmailer->Host = $mail_host ? $mail_host : 'smtp.qq.com';//修改为你使用的邮箱SMTP服务器
$phpmailer->Port = $mail_port ? $mail_port : '465';//SMTP端口
$phpmailer->Username = $mail_username ? $mail_username : '88888888@qq.com';//邮箱账户
$phpmailer->Password = $mail_passwd ? $mail_passwd : '123456789';//邮箱密码(此处填写QQ邮箱生成的授权码)
$phpmailer->From = $mail_username ? $mail_username : '88888888@qq.com';//邮箱账户
$phpmailer->SMTPAuth = _cao('mail_smtpauth') == 1 ? true : false;
$phpmailer->SMTPSecure = $mail_smtpsecure ? $mail_smtpsecure : 'ssl';
}
}
add_action('phpmailer_init', 'mail_smtp');
感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
暂无评论内容