使用php发送邮件问题 [英] send mail using php problem

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

问题描述

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:\wamp\www\database\email.php on line 5


php.ini设置如下


php.ini setting is as follows

[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@yourdomain.com


我正在使用wampserver& Windows XP.
是否需要更改php.ini的设置或任何其他解决方案.请帮助.
谢谢.


I am use wampserver & windows xp.
Is there is need to change the setting of php.ini or any other solution.please help.
Thanks.

推荐答案

你好朋友,
我的问题解决了.我使用sendmail发送电子邮件.
首先下载sendmail并将其保存在wamp目录中.sendmail exe的路径在php.ini文件中设置,例如sendmail_path ="c:\ wamp \ ...".
现在在php.ini文件中设置smtp服务器名称,端口号,您的gmail或任何其他邮件ID并保存.
现在在sendmail配置文件中设置以下内容

smtp_server = smtp.gmail.com
smtp_port = 25
auth_username =您的邮件ID
auth_password =密码
pop3_username =您的邮件ID
pop3_password =密码
force_sender =邮件ID.

保存更改并重新启动服务器.
Hello friends,
My problem is solved.I use sendmail for sending email.
first download sendmail and keep it in wamp directory.The path of sendmail exe is set in php.ini file like sendmail_path="c:\wamp\...".
Now in php.ini file set ur smtp server name,port number,your gmail or any other mail id and save it.
Now in sendmail configuration file set following

smtp_server=smtp.gmail.com
smtp_port=25
auth_username=your mail id
auth_password=password
pop3_username=your mail id
pop3_password=password
force_sender=mail id.

save the changes and restart the server.


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

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