【问题标题】:How to Send mail on localhost using xmapp and wordpress如何使用 xampp 和 wordpress 在 localhost 上发送邮件
【发布时间】:2012-12-21 00:48:26
【问题描述】:

我的系统上安装了xmapp,我正在为我的网站使用 WordPress。现在在 WordPress 中,我使用联系表格 7 来发送邮件,当我从这个表格发送邮件时,它给了我错误,即联系你的系统管理员 bla bla bla ...

我为此目的使用了 wp mail SMTP 并正确配置了站点

在我的sendmail.ini 中,我设置了以下内容:

smtp_server=pop.gmail.com 

smtp_port=587 

smtp_ssl=TLS    

;default_domain=localhost 

auth_username= noreply@bllsoft.com    

auth_password= ------- 

hostname=localhost

在我的 php.ini 文件中,我设置了以下内容:

;SMTP = 

;smtp_port = 25

; sendmail_from = noreply@bllsoft.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path

sendmail_path = "C:\xampp\sendmail\sendmail.exe -t -i"

我要做的就是修复它,但没有得到我想要的结果。

在 wamp 中,我已经完成了相同的设置,并且能够正确地从本地主机发送邮件,对此我很满意。

有时在 xampp 中,邮件发送消息来了,但我的收件箱中没有收到邮件,在这种情况下谁能帮助我

非常感谢您。

【问题讨论】:

  • @Daya,这完全是错误的。 PHP 的mail很多 问题,但这不是其中之一。
  • 嗯。您的配置正在尝试使用 pop.gmail.com 作为 SMTP 服务器。你不应该使用smtp.gmail.com吗?
  • @Charles :我尝试了很多,但一次又一次地失败,即使它与 wamp 一起工作正常,我也不知道 xampp 会发生什么。
  • 哪位高手解决这个问题?????

标签: php xampp sendmail.exe


【解决方案1】:

如果您想使用 wordpress 从 localhost 发送邮件并且您想使用您的 gmail 帐户发送邮件,那么您可以使用 gmail SMTP 邮件服务器。

为了简化,你可以使用这个插件

http://wordpress.org/plugins/wp-mail-smtp/

进入其设置页面(设置下的电子邮件子菜单)并选择以下选项:

Mailer: send all wordpress emails via SMTP

SMTP Options:
SMTP Host:smtp.gmail.com
SMTP Port:465
Encryption: Yes, use SMTP authentication
Username: **yourfullemail**@gmail.com
Password: **yourgmailpassword**

【讨论】:

    【解决方案2】:

    sendmail.ini 下,尝试将smtp_server = pop.gmail.com 更改为smtp_server = smtp.gmail.com

    【讨论】:

      【解决方案3】:

      第 1 步

      在您的 php.ini 文件中,通常在 'C:\xampp\php' 上找到

      编辑[邮件功能]

      [mail function]
      SMTP=smtp.gmail.com
      smtp_port=587
      sendmail_from = youremail@gmail.com
      sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
      

      第 2 步

      在通常位于“C:\xampp\sendmail”的 sendmail.ini 文件中

      编辑[发送邮件]

      [sendmail]
      smtp_server=smtp.gmail.com
      smtp_port=587
      error_logfile=error.log
      debug_logfile=debug.log
      auth_username=youremail@gmail.com
      auth_password=yourpassword
      

      第 3 步

      重启 Apache

      第 4 步

      在您的 gmail 帐户上 我的帐户 > 登录和安全

      打开“允许安全性较低的应用”

      【讨论】:

        【解决方案4】:

        这是我基于MailHog的sn-p你需要先安装MailHog然后配置它只需要添加下一个sn-p到你的functions.php

        https://gist.github.com/khalidahmada/74c3ba52e7d179e323b30d97f4847ec6

        请注意,您需要配置您的规则来检查默认情况下是否打开本地规则测试常量'WP_HOME' 到您的wp-config.php 是否包含您需要指定的“测试”或“本地”自己的角色统治sn-p中的函数isLocal()

        【讨论】:

          猜你喜欢
          • 2019-04-05
          • 2015-12-16
          • 1970-01-01
          • 2012-05-07
          • 2015-01-05
          • 2018-10-16
          • 2018-08-02
          • 1970-01-01
          • 2018-02-24
          相关资源
          最近更新 更多