Debugging PHP Mail() And/Or PHPmailer

Debugging PHP Mail() and/or PHPMailer

It looks like the class.phpmailer.php file is corrupt. I would download the latest version and try again.

I've always used phpMailer's SMTP feature:

$mail->IsSMTP();
$mail->Host = "localhost";

And if you need debug info:

$mail->SMTPDebug  = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only

Debugging PHP Mail with phpmailer and XAMPP to Yahoo email

I think you're missing a mailserver. Or have you a local mailserver running at port 25? ;-) But XAMPP brings a mailserver with it named Mercury - so... start it and have fun ;-).

PHPMailer only sends email when SMTPDebug = true

By setting

        $mail->SMTPDebug = false;

instead of omitting the line completely, it works every time.

View log PHPMailer

First of all, you're using a very old version of PHPMailer. Get the latest.

Your actual problem is very simple:

//$mail->IsSMTP(); // telling the class to use SMTP

You have no SMTP debug output because you not asked PHPMailer to use SMTP, so its using PHP's internal mail() function to send, and that generates no debug output.

Just uncomment that line and you'll have debug output.



Related Topics



Leave a reply



Submit