PHPMailer is a great little mail sending workhorse class for PHP, widely expanding on the regular PHP mail() function and particularly easy to make use of, making it a personal favourite of mine.
Anyway, to check whether or not your mail send was successful when using PHPMailer, all you need to do is check the Boolean variable returned by the Send() function, and if false, check what the error message contained in ErrorInfo is.
In practice:
require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "smtp1.example.com;smtp2.example.com"; $mail->SMTPAuth = true; $mail->Username = 'smtpusername'; $mail->Password = 'smtppassword'; $mail->AddAddress("email@example.com"); $mail->Subject = "Test 1"; $mail->Body = "Test 1 of PHPMailer."; if(!$mail->Send()) { echo "Error sending: " . $mail->ErrorInfo; } else { echo "E-mail sent"; }
As simple as that! :)