如何让XAMPP在本地使用php的mail()函数,这样我就可以在本地测试我的mail()脚本而无需上传到我的服务器?

Sim*_*Suh 7 php email xampp thunderbird

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

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


  1. 已安装XAMPP(已成功安装,因为我已将其用于其他工作)
  2. 为XAMPP安装了Mercury
  3. 在水星

a. click on Configuration -> Manage Local Users
b. Create New User
Run Code Online (Sandbox Code Playgroud)
          Username: **root**
          Password: **root**
c. click on Configuration -> Mercury SMTP
d. make the following changes
Run Code Online (Sandbox Code Playgroud)
          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
Run Code Online (Sandbox Code Playgroud)
          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
Run Code Online (Sandbox Code Playgroud)
          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
Run Code Online (Sandbox Code Playgroud)
          POP3 Host: **127.0.0.1**
          Username: **root**
          Password: **root**
Run Code Online (Sandbox Code Playgroud)

4.安装Thunderbird 3 5.在Thunderbird中


a. click on Tools -> Account Settings
b. In Account Settings
Run Code Online (Sandbox Code Playgroud)
    i. click on Account Actions -> Add Mail Account
    ii. In Add Mail Account
Run Code Online (Sandbox Code Playgroud)
        Your name: **root**
        Email address: **root@localhost.com**
        Password: **root**
    iii. click next
    vi. under Editing Config set as following
Run Code Online (Sandbox Code Playgroud)
        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.)
Run Code Online (Sandbox Code Playgroud)

4.测试PHP mail()脚本(我还没有完成此步骤,因为我还没有能够成功设置本地邮件服务器.)

Ash*_*ggs 6

当我遇到麻烦时,这些帮助了我.

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

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

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