1、配置前准备插件
configure-smtp.3.1 发送邮箱配置插件 传送门:https://wordpress.org/plugins/configure-smtp/
replymail 评论回复邮箱提醒插件 传送门: https://wordpress.org/plugins/replymail/
2、安装配置Configure SMTP 插件
注意这里的SMTP password要填QQ邮箱授权码
QQ邮箱-设置-账户-生成授权码
点Save Chages保存配置
点Send test e-mail 测试邮件是否发送成功。如果失败请执行步骤3。
3、测试服务器是否支持mail()函数。
主目录创建mail.php文件代码如下。然后输入:你的域名/mail.php 提示message was sent! 且收到测试邮件说明支持。
<?php $txt = "hello"; // 以下的邮箱地址改成你的 $mail = '1169830941@qq.com'; // 发送邮件 mail($mail, "My subject", $txt); echo 'message was sent!'; ?>
4、iis下php mail函数的sendmail配置方法(官方推荐)
首先你需要先到从http://glob.com.au/sendmail/下载sendmail.zip文件,点此可以直接下载噢,然后把它解压到如C:\php\sendmail\目录下。
打开:php.ini文件 搜索 [mail function] 定位到下面代码
[mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. ;sendmail_from = me@example.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; sendmail_path = "" ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters =
把SMTP = localhost和smtp_port = 25前面加上”;”然后把sendmai_path=””前面的”;”删掉,改为sendmai_path=”c:\php\sendmail\sendmail.exe -t”
接着修改sendmail目录下的sendmail.ini文件,主要填的内容有以下几项
mtp_server=smtp服务器地址(如 smtp.qq.com)
auth_username=邮箱登录名(如 470038532@qq.com)
auth_password=邮箱密码(如 你的qq邮箱密码;一定要填授权码:QQ邮箱-设置-POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务-生成授权码)
force_sender=发件人地址全写(如 470038532@qq.com)
smtp_ssl=auto
保存重启IIS或Apache。
另外下载的插件啊 🙂
@枫小子 插件那里搜或者百度搜都行 感觉WordPress的插件商城好慢 外国服务器原因?
@枫小子 加了传送门了 :redface:
@枫小子 弄好了吗? 😛