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
Get the Date of Next Monday, Tuesday, etc
How to Get the Real Url After File_Get_Contents If Redirection Happens
PHP Check If File Contains a String
PHP Append One Array to Another (Not Array_Push or +)
How to Loop Through an Associative Array and Get the Key
Html - Change\Update Page Contents Without Refreshing\Reloading the Page
Session Data Lost in Chrome Only
Why Doesn't MySQL Support Millisecond/Microsecond Precision
Why Is This PHP Call to Json_Encode Silently Failing - Inability to Handle Single Quotes
Visual Studio Code PHP Intelephense Keep Showing Not Necessary Error
Doctrine 2 and Many-To-Many Link Table With an Extra Field
PHP Get All the Images from Url Which Width and Height ≫=200 More Quicker
How to Use PHP Namespaces With Autoload
PHP Domdocument Errors/Warnings on Html5-Tags
Laravel - Eloquent or Fluent Random Row
Smtp Connect() Failed. Message Was Not Sent.Mailer Error: Smtp Connect() Failed