RiPro主题发送邮件只显示发送者邮箱问题 怎么修复?

发布于 2019-12-18 18:45:05

RiPro主题发送邮件只显示发送者邮箱问题 怎么修复?有知道的吗?

查看更多

关注者
0
被浏览
62
1 个回答
Tsks
Tsks 认证专家 2019-12-18

1.打开 ripro->inc->codestar-framework->options->options.theme.php文件
image.png

2.查找“SMTP设置”,修改如图红框所示位置
3.修改后代码展示

array(
            'id'       => 'mail_address',
            'type'     => 'text',
            'title'    => '发信邮箱',
            'subtitle' => '请填写发件人邮箱帐号',
            'default'  => '[email protected]',
            '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 : '[email protected]';//邮箱账户
        $phpmailer->Password   = $mail_passwd ? $mail_passwd : '123456789';//邮箱密码(此处填写QQ邮箱生成的授权码)
        $phpmailer->From       = $mail_username ? $mail_username : '[email protected]';//邮箱账户
        $phpmailer->SMTPAuth   = _cao('mail_smtpauth') == 1 ? true : false;
        $phpmailer->SMTPSecure = $mail_smtpsecure ? $mail_smtpsecure : 'ssl';
 
    }
}
add_action('phpmailer_init', 'mail_smtp');

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览