问题描述
当我尝试用 PHP 发送电子邮件时,我不断收到此错误:
I keep getting this error when I try to send an e-mail in PHP:
Warning: mail() [function.mail]: 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:wampwwwdressoholic
egister.php on line 50
我的 php.ini 看起来像这样:
my php.ini looks like this:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = you@yoursite.com
我将笔记本电脑用作服务器.我做错了什么?谢谢.
I'm using my laptop as a server.. What am I doing wrong? Thanks.
推荐答案
你需要在本地运行一个邮件服务器.如果这是 Unix,请启用 sendmail如果这是 Windows,请安装 II 的 Simple Mail Transfer Server(不确定名称是否正确)组件.例如.对于 Windows 2003,请遵循:http://msdn.microsoft.com/en-us/library/8b83ac7t.aspx
You need to be running a mail server locally. If this is Unix, enable sendmail If this is Windows install the Simple Mail Transfer Server (not sure if the name is correct) component of IIs. E.g. for windows 2003 follow this: http://msdn.microsoft.com/en-us/library/8b83ac7t.aspx
这篇关于无法连接到“localhost"的邮件服务器端口 25的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!