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
      评论
    自动邮件发送博客文章的WordPress插件完成一项很简单的功能,每当一篇博客文章发布后,WordPress会自动发送一封Email邮件到几个指定的电子信箱之中。这个 插件是修改自一个名为Post2Mail的邮件插件,可惜原插件作者已经删除此插件的下载和更新,而且原插件不支持中文,中文内容的文章将被发送为乱码, 同时原插件还有一个小小的安全漏洞,别人可以查看配置源代码。因此我就在这个插件的基础上进行了一番修改,修改相关的问题并使其完全支持中文系统。   新增加的功能   1、使用base64对中文邮件标题进行编码,完美支持中文邮件标题,在任何客户端显示都没有邮件标题乱码。   2、邮件的内容也完美支持中文。   3、修改了原来插件的安全漏洞。   如何使用这个插件   修改post2mail.config.php文件,增加邮件地址到配置文件中,我们知道MSN Live Spaces和Blogspot都有邮件发布博客功能,我们可以将Live Spaces和Blogspot的邮件发送地址填入,这样,每当我们在WordPress中发布一篇文章,这篇文章都会自动更新到MSN Spaces和BlogSpot.这样就可以同时更新三个博客了。   新的修改汉化版的POST2MAIL我目前在Google的Blogger和微软的MSN Spaces的邮件发送上测试成功,发送邮件的内容均没有乱码。   本程序在Apache和PHP5环境下测试通过,不需要配置邮件服务器就可以发送邮件

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

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

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

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

    打赏作者

    车斗

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

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

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

    打赏作者

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

    抵扣说明:

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

    余额充值