Failed to connect to mailserver at quot;localhostquot; port 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法连接到“localhost"的邮件服务器端口 25
基础教程推荐
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何替换eregi() 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
