duanjiao7440 2012-02-04 07:41
浏览 46
已采纳

禁用PHP邮件功能的警告

When I call the PHP mail function on my testing server I receive a warning. This is correct because I have no mail server enabled to test the system when mall fails. I want this function not to throw the warning though. How will I achieve this?

The function itself should still fail though (i.e. return false).

  • 写回答

3条回答 默认 最新

  • 普通网友 2012-02-04 07:44
    关注
     use @mail(parameters...)
    

    @supresses any error reporting output mail might produce

    You can also suprress warnings all together

     error_reporting(E_ALL ^E_WARNING) to supress warnings all together
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?