PHP中的邮件功能问题 [英] Problem with mail function in php

查看:77
本文介绍了PHP中的邮件功能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

mail()[function.mail]:无法通过"localhost"端口25连接到邮件服务器,无法验证php.ini中的"SMTP"和"smtp_port"设置,或在C:\ Program Files \中使用ini_set()第70行的wamp \ www \ classic \ index.php


谁能帮我

如何解决这个问题
我在邮件功能中用作

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:\Program Files\wamp\www\classic\index.php on line 70


please can anyone help me

how to resolve this
and i used in mail function as

mail($Email, 'Registration Confirmation', $message, 'From: munchchoudhry@gmail.com');
ini_set("SMTP","localhost");
ini_set("SMTP_PORT", 25);
ini_set("sendmail_from","munchchoudhry@gmail.com");




并在我的php.ini文件中为




and in my php.ini file as

[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 = munchchoudhry@gmail.com




那是什么邮件服务器,以及要做什么全部更改?




what is that mail server and what all changes to do

推荐答案

电子邮件,'

消息,来自:munchchoudhry@gmail.com'); ini_set(" " localhost"); ini_set(" 25 ) ; ini_set(" munchchoudhry@gmail.com");
message, 'From: munchchoudhry@gmail.com'); ini_set("SMTP","localhost"); ini_set("SMTP_PORT", 25); ini_set("sendmail_from","munchchoudhry@gmail.com");




并在我的php.ini文件中为




and in my php.ini file as

[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 = munchchoudhry@gmail.com




那个邮件服务器是什么,所有要做的更改




what is that mail server and what all changes to do


好,问题很明显.对于第一步,请确保SMTP服务器确实在所述主机上执行,在您的情况下为localhost.您是否对它进行了独立测试?没有它,显然没有任何工作. :-)

如果没有此服务器,则可以在其他主机上运行一些合适的服务器,而您需要知道并使用它.如果这样做却无济于事,请使用mail显示您的PHP代码示例.

—SA
OK, the question is clear. For the first obvious step, make sure the SMTP server is really executing on the said host, which is localhost in your case. Did you test it independently? Without it, nothing can work, apparently. :-)

If you don''t have this server, some suitable server running on some different host should work — you need to know and use one. If you do it and it does not help, please show your PHP code sample using mail.

—SA


这篇关于PHP中的邮件功能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆