我想通过本地托管的 php 代码发送电子邮件。
<?php
$email = "[email protected]";
$titre = "My subject";
$message = "Text message !";
mail($email, $titre, $message);
?>
当我运行此代码时,出现以下错误:
Warning: mail() [<a href='function.mail'>function.mail</a>]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\...
我走进了php.ini
文件,它似乎已经配置良好。
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
我怎样才能解决这个问题 ?
谢谢
它被配置为使用localhost:25
对于邮件服务器。
错误消息说无法连接到localhost:25
.
因此你有两个选择:
- 在本地主机端口 25 上安装/正确配置 SMTP 服务器
- 更改配置以指向您指定的其他 SMTP 服务器can连接到
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)