这里是frankniubi。今天没事干给大家写个如何用smtp来对外发送邮件。
这里就用multicraft来做演示,
1.如果你是linux主机请进入(目录没有改变的话)/var/www/html/multicraft/protected/config/internal/application.php(靠背的,如果我记错了自己找找正确的路径或者给我留言。)
2.往下滑,找到smtp什么的,这里记得把*/ /*注释去掉来启用smtp
官方是这么说的:
Send mails using SMTP instead of PHP mail()
If you want to send emails directly through an SMTP server instead of using the PHP mail() function you can edit the file protected/config/internal/application.php and look for the line:'transportType'=>'smtp'
Remove the "/*" and "*/" around this block of code and configure the values accordingly to use your SMTP server.
然后server这里填写你自己的smtp服务器。
如果说你没有的话,请自行去mail.google.com 注册一个账户
然后地址填写 smtp.gmail.com port(端口)填写465(默认即可) 用户名密码就是你的谷歌账户名字
这里我就不放出来我们自己的了。
填好保存上传到服务器
请注意:不要忘记修改再设置中的管理员邮件地址。不然可能会出现问题。
好消息:现在 blog.mcbar.cc 上点击打赏,满10元就送mc服务器一个月,满25就送一个月vps!
多打赏多得!
这里就用multicraft来做演示,
1.如果你是linux主机请进入(目录没有改变的话)/var/www/html/multicraft/protected/config/internal/application.php(靠背的,如果我记错了自己找找正确的路径或者给我留言。)
2.往下滑,找到smtp什么的,这里记得把*/ /*注释去掉来启用smtp
官方是这么说的:
Send mails using SMTP instead of PHP mail()
If you want to send emails directly through an SMTP server instead of using the PHP mail() function you can edit the file protected/config/internal/application.php and look for the line:'transportType'=>'smtp'
Remove the "/*" and "*/" around this block of code and configure the values accordingly to use your SMTP server.
然后server这里填写你自己的smtp服务器。
如果说你没有的话,请自行去mail.google.com 注册一个账户
然后地址填写 smtp.gmail.com port(端口)填写465(默认即可) 用户名密码就是你的谷歌账户名字
这里我就不放出来我们自己的了。
填好保存上传到服务器
请注意:不要忘记修改再设置中的管理员邮件地址。不然可能会出现问题。
好消息:现在 blog.mcbar.cc 上点击打赏,满10元就送mc服务器一个月,满25就送一个月vps!
多打赏多得!