【问题标题】:mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.inimail(): 无法在“localhost”端口 25 连接到邮件服务器,请验证 php.ini 中的“SMTP”和“smtp_port”设置
【发布时间】:2021-03-14 19:22:05
【问题描述】:

是的,我知道这可能是该问题的第 100 次重复,但我查看了此线程:How to configure XAMPP to send mail from localhost? 和许多其他线程,但仍然无法正常工作。我的同学今天早些时候做了同样的事情,对他来说一切都很好。我什至询问了他的 .ini 文件和代码,它仍然无法正常工作。我还重新安装了 xampp 以查看是否可以修复它,但它没有。

php.ini:

[mail function]

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = maill@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe" -t"

sendmail.ini

smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=ssl
error_logfile=error.log
debug_logfile=debug.log
auth_username=maill@gmail.com
auth_password=magicalpwd
force_sender=galerijospastas@gmail.com

这个项目永远不会上线,在 xampp 的帮助下,一切都可以在我的机器上运行。 这同样适用于我的同学,但对他来说有效,我错过了什么?

【问题讨论】:

  • 你设置了 587 端口,怎么会在 25 端口出现错误?还有什么吗?
  • 可能是 thisthisthis 可以提供帮助。
  • 您缺少exe" 之间的反斜杠
  • sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

标签: php email


【解决方案1】:

用途:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-03
    • 2012-08-02
    • 2017-02-04
    • 1970-01-01
    • 2011-01-21
    • 2021-12-24
    相关资源
    最近更新 更多