wordpress建设博客或电商网站之四:解决发送邮件和用户注册的BUG

 wordpress建设博客或电商网站之四

解决发送邮件和用户注册的BUG


1 发送邮件

我的电商网站pepstack.com用QQ的SMTP服务发送邮件,因此需要使用一个插件:Configure SMTP。管理员登陆站点,进入管理员界面。插件->安装插件:Configure SMTP,设置如下:

end e-mail via GMail? 
Clicking this will override many of the settings defined below. You will need to input your GMail username and password below.
SMTP host 
If "localhost" doesn't work for you, check with your host for the SMTP hostname.
SMTP port 
This is generally 25.
Secure connection prefix
  •  
  •  
  •  
    Sets connection prefix for secure connections (prefix method must be supported by your PHP install and your SMTP host)
  • Use SMTPAuth? 
    If checked, you must provide the SMTP username and password below
    SMTP username
    SMTP password
    Wordwrap length 
    Sets word wrapping on the body of the message to a given number of characters.
    Enable debugging? 
    Only check this if you are experiencing problems and would like more error reporting to occur. Uncheck this once you have finished debugging.
    Sender e-mail 
    Sets the From e-mail address for all outgoing messages. Leave blank to use the WordPress default. This value will be used even if you don't enable SMTP. NOTE: This may not take effect depending on your mail server and settings, especially if using SMTPAuth (such as for GMail).
    Sender name 
    Sets the From name for all outgoing messages. Leave blank to use the WordPress default. This value will be used even if you don't enable SMTP.
     

    其中STMP password使用的是QQ的SMTP授权码而不是我登陆QQ的口令。master@pepstack.com是我的QQ邮箱设置为域名邮箱。用户可以直接使用自己的QQ邮箱(打开POP3,SMTP等服务)。这样一个可以发送邮件的网站就好了。


    2 激活注册邮件BUG

    然而我在pepstack.com新注册的用户(用我另外的QQ号)时,却无法激活注册邮件。错误类似:

    WordPress 密码重置提示 您的密码重设链接无效

    http://blog.csdn.net/h1217/article/details/53422835


    解决办法是修改2个文件:

    /opt/wordpress/wp-login.php

    /opt/wordpress/wp-includes/pluggable.php


    1) /opt/wordpress/wp-login.php: 约332行

    原代码:

    $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";

    修正后:

            $message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login');
    

    2) /opt/wordpress/wp-includes/pluggable.php: 约1791行

    原代码:


            $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user->user_login), 'login') . ">\r\n\r\n";

            $message .= wp_login_url() . "\r\n";


    修正后:

            $message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user->user_login), 'login');
    
            /*
            $message .= wp_login_url() . "\r\n";
            */
    


    然后重启服务:

    $ sudo  service apache2 reload


    #### $ sudo  service apache2 stop

    #### $ sudo  service apache2 start

    #### $ sudo  service apache2 restart





    • 2
      点赞
    • 0
      收藏
      觉得还不错? 一键收藏
    • 打赏
      打赏
    • 0
      评论

    “相关推荐”对你有帮助么?

    • 非常没帮助
    • 没帮助
    • 一般
    • 有帮助
    • 非常有帮助
    提交
    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包

    打赏作者

    车斗

    你的鼓励将是我创作的最大动力

    ¥1 ¥2 ¥4 ¥6 ¥10 ¥20
    扫码支付:¥1
    获取中
    扫码支付

    您的余额不足,请更换扫码支付或充值

    打赏作者

    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值