Using offline server in PHP

半世苍凉 提交于 2019-12-13 09:21:57

问题


I'm having problems using the mail command in PHP through an offline server. I've used the mail(to, subject, body) function but the mail wasn't sent to the address. Should I be online?


回答1:


No, your problem is that you have no SMTP server installed. I suggest you to check on of these:

  • Pdf tutorial to create your own SMTP Server

  • Online tutorial

  • Online tutorial #2

  • Alternative way to find out

After successfull setting it up, you'll need to configure your php.ini too, to point at the SMTP you are using.


Or instead of creating your own, you can google how to use someone else's SMTP. The choice is yours.




回答2:


if you are running code from local server then mail function will not send mail. Mail function need live mail server. You can use smtp mail to send mail from local server.



来源:https://stackoverflow.com/questions/29716458/using-offline-server-in-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!