无法连接到“localhost"的邮件服务器端口 25

Failed to connect to mailserver at quot;localhostquot; port 25(无法连接到“localhost的邮件服务器端口 25)
本文介绍了无法连接到“localhost"的邮件服务器端口 25的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试用 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)