无法通过php邮件发送邮件() [英] Unable to send mail via php mail()

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

问题描述

我无法通过php的邮件功能发送电子邮件。



这是我收到的错误。
警告:mail()[function.mail]:无法在localhost端口25连接到mailserver,验证php.ini中的SMTP和smtp_port设置或在D:\\中使用ini_set()在线6上的\\inetpub\vhosts\southernbatteries.com\httpdocs\includes\utils.php
数组([0] => [1] =>无法发送邮件,请稍后再试... 。)



这是什么意思?这是否意味着我的网络服务器上没有安装邮件服务器?是否可以使用不同的邮件服务器。例如邮件邮件服务器发送邮件?

解决方案

如果要使用内置的邮件( ),您需要与服务器管理员交谈。可以在Windows上使用外部SMTP服务器,但必须在php.ini设置中指定,而PHP的内置函数不支持SMTP验证。



通常的方式是使用本地邮件服务器,然后可以使用认证与真实的SMTP服务器进行通信,或者使用邮件包(如 SwiftMailer ,可以直接连接到像GMail这样的第三方SMTP服务器。


I am unable to send an email via php's mail function.

This is the error I receive. 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 D:\inetpub\vhosts\southernbatteries.com\httpdocs\includes\utils.php on line 6 Array ( [0] => [1] => Could not send mail, please try later... )

What exactly does this mean ? Does it mean there is not mail server installed on my webserver ? Is it possible to use a different mail server. E.g Gmails mail server to send the mail ?

解决方案

If you want to use built-in mail(), you will need to talk to the server administrator. It is possible to use an external SMTP server on Windows, but it has to be specified in the php.ini settings, and PHP's built-in functions don't support SMTP authentication.

The usual way is to either use a local mail server that in turn can talk to a "real" SMTP server with authentication, or use a mailing package like SwiftMailer that can connect to a 3rd party SMTP server like GMail directly.

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

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