Turn off PEAR Errors

129 Views Asked by At

I'm using PEAR's Mail_Queue and unfortunately there are many deprecation warnings (this is a common SO topic). Of course I can modify php's config to silence non-fatal errors but even then it seems that PEAR's mail_mime is outputting header information when it throws an error of any kind.

Is there a simple way to turn off PEAR errors completely so that I can modify header information after making a call to mail_queue?

1

There are 1 best solutions below

0
On

This are not "PEAR errors" that can be turned off. As you said yourself, it's PHP spilling out the warnings, and you can only tell PHP not to output them.

Use the following code before using Mail_Queue to silence the warnings:

error_reporting(error_reporting() & ~E_DEPRECATED & ~E_STRICT);