localhost上的php mail()函数 [英] php mail() function on localhost

查看:362
本文介绍了localhost上的php mail()函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在localhost服务器上有php mail()的问题。当我尝试使用php函数
mail()发送电子邮件时,无法在localhost上测试我的电子邮件应用程序。

I have problem with php mail() function on localhost server. I can't test my email application on localhost when i'm trying to send emails with php function mail().

我收到此错误
警告:mail()[function.mail]:无法连接到mailserver在localhost 端口25,验证php.ini中的SMTP和smtp_port设置,或在第64行的F:\wamp\www\product\ajax.php中使用ini_set()

我正在使用WAMP服务器,如果有人知道解决方案,请帮助我。

I'm using WAMP server and if anyone knows solution please help me.

推荐答案

您需要在计算机上设置邮件服务器以使邮件功能正常工作。如果你在Windows上(我猜你是使用WAMP),你可以设置一个 Pegasus邮件服务器

其他选项包括使用包装类,如 SwiftMailer PHPMailer ,并使用它们连接到另一个SMTP服务器,如您的GMail帐户。即使你在自己的本地路由上去了Pegasus邮件服务器,那么我仍然建议使用上面提到的两个类之一。他们给你的灵活性更高,更安全。

Other options include using a wrapper class such as SwiftMailer or PHPMailer and using them to connect to another SMTP server such as your GMail account. Even if you go the Pegasus mail server on your own localhost route then I would still recommend using one of the two classes I have mentioned above. They give you far more flexibility and are safer.

连接到您的ISP的SMTP服务器或GMail,或者是最简单的路由。

Connecting to either your ISPs SMTP server or GMail or whatever is the easiest route out of this one.

这篇关于localhost上的php mail()函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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