php 警告:出于安全原因,mail() 已被禁用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23603213/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:50:08  来源:igfitidea点击:

Warning: mail() has been disabled for security reasons

phpemail

提问by geoff

Good morning,

早上好,

Today I have found something wrong in my website when I try to send an e-mail trough the mail() PHP function. The mail is not sent and I have this error message:

今天,当我尝试通过 mail() PHP 函数发送电子邮件时,我发现我的网站有问题。邮件未发送,我收到此错误消息:

Warning: mail() has been disabled for security reasons in /home/user/html/modules/mod_jumi/tmpl/default.php(18) : eval()'d code on line 57

What can I do in order to know which is the problem in this module? I have to enable the mail() function somewhere in my Joomla 3.3?

我该怎么做才能知道此模块中的问题是什么?我必须在 Joomla 3.3 的某处启用 mail() 函数吗?

And that's my line 57:

这是我的第 57 行:

mail('[email protected]','Contact from',$message,$headers);

Thanks,

谢谢,

Regards,

问候,

回答by geoff

It means that whatever host you're using has disabled mail(). Note that mail()can be used to send out mass spam, for example:

这意味着您使用的任何主机都已禁用mail(). 请注意,mail()可用于发送大量垃圾邮件,例如:

while(true) {
    mail('[email protected]','Contact from',$message,$headers);
}

A lot of shared hosts throttle mail()or outright disable it. You'll have to contact your hosting provider about the issue.

许多共享主机限制mail()或彻底禁用它。您必须就该问题联系您的托管服务提供商。