简体   繁体   English

PHP邮件函数返回服务器错误

[英]PHP mail function return Server Error

I am a PHP newbie coder. 我是PHP新手编码员。 Currently I am studying the mail function of PHP but the function always give me error such as Server error. 目前,我正在研究PHP的邮件功能,但该功能始终会给我错误,例如服务器错误。 I don't know if I have to install a software or configure the server first. 我不知道我是否必须先安装软件或配置服务器。 By the way, I use Phpdev for my development environment. 顺便说一下,我将Phpdev用于我的开发环境。

if(mail("me@gmail.com", "Hi","This is a test"))
{
   echo "Success";
}
else
{
   echo "Failed";
}

Many thanks. 非常感谢。

is your mail server configured? 您的邮件服务器是否已配置? see the [mail function] section of the php.ini file and configure it if not. 请参阅php.ini文件的[邮件功能]部分,如果没有,请进行配置。 specific instructions are in the sample php.ini files included with your distribution and differ depending on whether you're on windows or *nix. 具体说明在您的发行版随附的示例php.ini文件中,具体取决于您使用的是Windows还是* nix。

-don -don

from my knowledge phpdev does not have a server mail, so the mail shoul not work. 据我所知,phpdev没有服务器邮件,因此该邮件不起作用。 But it should just print out Failed. 但是它应该只打印失败。 What do you mean it throws a server error ? 您是什么意思,它引发服务器错误?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM