【问题标题】: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?如何让 XAMPP 在本地使用 php 的 mail() 函数,这样我就可以在本地测试我的 mail() 脚本而无需上传到我的服务器?
【发布时间】:2011-05-28 00:49:58
【问题描述】:

我目前正在使用 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

          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。安装雷鸟 3 5. 在雷鸟中


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。测试 PHP mail() 脚本(我还没有到这一步,因为我还没有能够成功设置本地邮件服务器。)

【问题讨论】:

  • localhost.com?试试localhost。另外,你把邮件寄到哪里?

标签: php email xampp thunderbird


【解决方案1】:

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

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

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

可以从 Xampp 控制面板激活 Mercury。

【讨论】:

  • 第二个 - 视频 - 极大地帮助了我。我讨厌使用 youtube 视频来尝试跟随,所以我最终停顿了很多,希望有人能做出明确的书面说明。
猜你喜欢
  • 1970-01-01
  • 2011-07-17
  • 2016-08-12
  • 1970-01-01
  • 2023-03-29
  • 2011-08-07
  • 2015-02-08
  • 2012-01-09
  • 1970-01-01
相关资源
最近更新 更多