Activate SMTP debugging in formmail script

If problems occur when sending e-mails via SMTP, it is useful to activate the diagnostic output.

If the outputs are activated, detailed status and error messages are displayed. These can be useful for diagnosing the problem.

First open the file “mail.php” in the folder “_logic” with a text editor (recommendation Notepad++):

Now insert the following line:

$mailer->SMTPDebug = 2;

The line must be inserted here, the line number may differ slightly depending on the version of the script:

Now test your form with the browser. After sending the form the output will appear. For better readability, activate the source code display in the browser:

To deactivate the diagnosis again, remove the line.

Leave a Reply

Your email address will not be published. Required fields are marked *