PHP 5.1.6 - PHP致命错误:调用未定义的函数mail()

时间:2011-05-13 19:18:54

标签: email phpmailer php

是否有人知道PHP 5.1.6的错误导致:
致命错误:调用未定义的函数mail()?

我有相同的代码在PHP 5.2.0中顺利运行,但在使用PHP 5.1.6的服务器上,不确定是否定义了邮件功能。 我确信问题不在代码本身,因为只是运行这个脚本:

// PHP 5.1.6
<?php 
if (function_exists('mail')){
    print 'mail is defined';
}
else{
    print 'mail is undefined';
}
?>

... php打印有时“邮件已定义”,有时“邮件未定义”。

1 个答案:

答案 0 :(得分:0)

我更喜欢使用PHPMailer

PHPMailer

您可以获得更多控件发送电子邮件,例如异常和获取邮件服务器响应