I received the mail continuously fine but suddenly I didn't receive any mail. I don't know what happened with my code also I didn't get any error in my error log file as well. I am using it on Godaddy server
$mails = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.gmail.com";
$mail->SMTPAuth = true;
$mail->Port = 587;
$mail->Username = "mymail@gmail.com";
$mail->Password = "myPassword";
$mail->From = "foo@gmail.com";
$mail->FromName = "John Doe";
$mail->AddAddress('foobar@foobar.com');
$mail->IsHTML(true);
$mail->Subject = "John Doe Lead Update";
$mail->Body = '
<h2>Mahindra Campaign Data</h2>';
if($mail->send()){
echo 'Message sent';
}
else
{
echo 'Mailer error' .$mail->ErrorInfo;
}