以下插件均基于Wordpress 3.3.2 版本测试
最近将虚拟主机由windows迁移到了Linux,刚在回复访客评论的时候出现了一下提示
Warning: is_writable() [function.is-writable]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/data/home/hmu097058/:/usr/home/oukan.net/:/data/home/tmp/:/usr/home/tmp/:/var/www/disablesite/) in /data/home/oukan/htdocs/love/wp-content/plugins/cimy-swift-smtp/Swift/lib/preferences.php on line 15
Warning: stream_set_blocking(): supplied argument is not a valid stream resource in /data/home/oukan/htdocs/love/wp-content/plugins/cimy-swift-smtp/Swift/lib/classes/Swift/Transport/StreamBuffer.php on line 273 279
我原先使用的是 Cimy Swift SMTP ,可以完美支持WIN主机,更换主机系统后出现函数错误,看来是 Cimy Swift SMTP 不支持Linux主机造成的。
马上更换SMTP插件,使用 WP MAIL SMTP 0.9.1 版本,作者为 Callum Macdonald,安装后配置,还是使用Gmail,也可以支持QQ邮箱(这个偶看没有测试)。
From Email(电子邮件地址) You can specify the email address that emails should be sent from. If you leave this blank, the default email will be used. (您可以指定电子邮件地址来发送电子邮件。如果留空,将使用默认的电子邮件。)
From Name(发件人名字) You can specify the name that emails should be sent from. If you leave this blank, the emails will be sent from WordPress. (可以指定发送邮件人的名称。如果留空,发件人名字则为WordPress。)
【此项不勾选】Return Path(返回路径) Return Path Set the return-path to match the From Email (返回路径匹配电子邮件)
SMTP Options(SMTP选项)
These options only apply if you have chosen to send mail by SMTP above.(这些选项仅适用于当你选择了发送SMTP邮件的时候。)
SMTP Host(SMTP主机):smtp.gmail.com
SMTP Port(SMTP端口):465
Encryption (加密)
No encryption.(不加密)
【选择此项】Use SSL encryption.(使用SSL加密)
Use TLS encryption. This is not the same as STARTTLS. For most servers SSL is the recommended option. (使用TSL加密,这不同于STARTTLS。对于大多数服务器,SSL是推荐的选项。)
Authentication (身份验证)
No: Do not use SMTP authentication.(不使用SMTP身份验证)
【选择此项】Yes: Use SMTP authentication.(使用SMTP身份验证)
If this is set to no, the values below are ignored. (如果如果此项设置为NO,下面的值将被忽略。)
Username (电子邮件名)
Password (电子邮件密码)
其实配置都是大同小异,选择SSL和465端口是要点。
经过测试, WP-MAIL-SMTP 插件可以在Linux下正常发送邮件。
Password:这里填我邮箱的登录密码吗?还是什么?
填写邮箱密码
Username:这里填我的邮箱地址吗?
比如:wangzhansl@qq.cm
正确
The SMTP debugging output is shown below:
SMTP -> ERROR: Failed to connect to server: Connection timed out (110)
The following From address failed: wangzhansl@qq.com
好像发送测试失败是啥问题呢?
出现这个问题,应该是设置出错导致的。使用qq邮箱需要端口465,勾选SSL验证。
SMTP Port:465
Encryption :Use SSL encryption.
都是按照你博文的方法设置的啊!!
请问大哥,我设置好这个插件以后如何用Linux主机发送邮件呢?不明白,如何测试呢?
有用!!!!
有用!!!!