PHPMailer 关闭debug, 输出。 如何设置
在PHPMailer中,可以通过设置SMTPDebug
属性为0来关闭debug输出。
具体代码如下:
$mail = new PHPMailer(true);
$mail->SMTPDebug = 0;
SMTPDebug
属性的值决定了PHPMailer的debug输出级别:
- 0: No output
- 1: Commands
- 2: Data and commands
- 3: As 2 plus connection status
- 4: Low-level data output
所以,设置$mail->SMTPDebug = 0;
将关闭debug输出。