doudou201701 2012-08-04 23:52
浏览 140

警告:mail()[function.mail]:无法连接到“localhost”端口25的邮件服务器,验证你的“SMTP”和“smtp_port”,XAMPP for WIndows XP

I am running a XAMPP server on Windows XP. Allegedly XAMPP automatically prepares a mail server.

This is the code I am using:

$cimzett = 'ledit4@gmail.com';
...
mail($cimzett, $targy, $uzenet, 'From:'.$email);

($cimzett means "to", $targy is subject, $uzenet is message in Hungarian) but in the browser appling PHP it sends me this message:

I get this error message:

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:\xampp\htdocs\PHP\alien.php on line 50

I tried to use set_ini() function too, but I got the same message.

Maybe the security properties of XAMPP does not allow me send an email to gmail.com?

I use PHP Version 5.3.5 and

SMTP localhost localhost smtp_port 25 25

are the settings reported by phpinfo();

I suspect the mail server is not working properly. What do you think?

  • 写回答

4条回答 默认 最新

  • doushi1996 2012-08-05 00:04
    关注

    Windows does not by default have an SMTP server installed. XAMPP won't install one for you either. If there IS one installed, then it's not running, because "connection refuse" on port 25 means nothing's there listening for email.

    XAMPP will also not disable connections to external mail servers. However, Windows firewalls and/or some ISPs will (my isp does not allow external smtp connections as an anti-spam measure).

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度