如何使XAMPP在本地使用php的mail()函数,以便我可以在本地测试我的邮件()脚本,而无需上传到我的服务器? [英] How do I enable XAMPP to locally use the php's mail() function so I can test my mail() scripts locally without having to upload to my server?

查看:115
本文介绍了如何使XAMPP在本地使用php的mail()函数,以便我可以在本地测试我的邮件()脚本,而无需上传到我的服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用XAMPP和Thunderbird 3,并希望将本地服务器设置为发送电子邮件(如gmail / hotmail /(anymail)),以便我可以测试出使用mail()函数的php脚本。这将节省一些时间,因为它将绕过繁琐的保存和上传php文件的步骤,每次进行小的更改。



我已经完成但没有工作(通过各种现有的在线教程)







  1. 安装的XAMPP(已成功安装,这对于我的其他工作)

  2. 为XAMPP安装Mercury

  3. 在Mercury






  a。点击配置 - >管理本地用户
b。创建新用户






 用户名:** root ** 
密码:** root **
c。点击配置 - >水星SMTP
d。进行以下更改






 要使用的IP接口:** 127.0.0.1 ** 
听TCP / IP端口:** 25 **
将自己声明为:** 127.0.0.1 **
即点击配置 - >水银POP 3
f。进行以下更改






 收听TCP端口:** 110 ** 
IP使用的接口:** 127.0.0.1 **
g。点击配置 - > MercuryE SMTP客户端配置
h。进行以下更改






 将自己识别为:** 127.0.0.1 ** 
名称服务器:** 127.0.0.1 **
i。点击配置 - > Mercury D pop3客户端
j。进行以下更改






  POP3主机:** 127.0.0.1 ** 
用户名:**根**
密码:**根**

4。安装的Thunderbird 3
5.在Thunderbird中






  a。点击工具 - >帐户设置
b。在帐户设置






 我点击帐户操作 - >添加邮件帐户
ii。在添加邮件帐户






 您的姓名:** root ** 
电子邮件地址:**root@localhost.com $
密码:**根**
iii。点击下一个
vi。在编辑配置下设置如下






 code>用户名:** root ** 
传入:127.0.0.1 POP / IMAP
传出:127.0.0.1 SMTP
v。单击创建帐户
c。发送测试邮件给自己(这部分不适用于我,它说邮件成功发送,但是当我在Thunderbird中检查收件箱时,没有邮件。)

4。测试PHP邮件()脚本(我还没有得到这一步,因为我还没有能够成功设置本地邮件服务器。)

解决方案

当我遇到困难时,这些帮助我。



http://www.danieltmurphy.com/setting-up-mercury-smtp/



http://www.youtube.com/watch?v=VU4PT7xMSO0



可以从Xampp控制面板激活水银。


I am currently using XAMPP and Thunderbird 3 and wish to set up my local server to send mail to e-mails like gmail/hotmail/(anymail) so I can test out my php scripts that are using the mail() function. It would save some time as it would bypass the step of tediously saving and uploading the php file every time a minor change is made.

Things I have done but have not worked: (through various existing tutorials online)


  1. Installed XAMPP (successfully installed as I already use this for my other work)
  2. Installed Mercury for XAMPP
  3. In Mercury


a. click on Configuration -> Manage Local Users
b. Create New User


          Username: **root**
          Password: **root**
c. click on Configuration -> Mercury SMTP
d. make the following changes


          IP Interface to use: **127.0.0.1**
          Listen to TCP/IP port: **25**
          Announce Myself as: **127.0.0.1**
e. click on Configuration -> Mercury POP 3
f. make the following changes


          Listen to TCP port: **110**
          IP Interface to use: **127.0.0.1**
g. click on Configuration -> MercuryE SMTP client Configuration
h. make the following changes


          Identify Myself as: **127.0.0.1**
          Name server: **127.0.0.1**
i. click on Configuration -> Mercury D pop3 client
j. make the following changes


          POP3 Host: **127.0.0.1**
          Username: **root**
          Password: **root**

4. Installed Thunderbird 3 5. In Thunderbird


a. click on Tools -> Account Settings
b. In Account Settings


    i. click on Account Actions -> Add Mail Account
    ii. In Add Mail Account


        Your name: **root**
        Email address: **root@localhost.com**
        Password: **root**
    iii. click next
    vi. under Editing Config set as following


        Username: **root**
        Incoming: 127.0.0.1   POP/IMAP
        Outgoing: 127.0.0.1   SMTP
    v. click Create Account
c. send test mail to myself (this part doesn't work for me, it says mail sent successfully but when I check inbox in Thunderbird, there is no mail.)

4. Test PHP mail() script (I haven't gotten to this step yet as I have not yet been able to successfully set up a local mail server.)

解决方案

These helped me out when I was having trouble.

http://www.danieltmurphy.com/setting-up-mercury-smtp/

http://www.youtube.com/watch?v=VU4PT7xMSO0

Mercury can be activated from the Xampp control panel.

这篇关于如何使XAMPP在本地使用php的mail()函数,以便我可以在本地测试我的邮件()脚本,而无需上传到我的服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆