I got this error using PHPMailer.
currently if i put under my localhost it go smoothly never came out any error, but once i put under my hosting it show an error smtp error: could not authenticate, please advise me what should i do..
and Here is the code.
$mail = new PHPMailer();
if(!empty($data->MEM_EMAIL)){
$header = "<font class='type3'>Dear ".$data->MEM_NAME.",\n<br><p>
<font class='type3'>Below is your password. Please login using :-<br><br>\n\n
</font>
<font class='type3'>Username : <b>".$data->MEM_UN."</b>\n<br>
<font class='type3'>Password : <b>".$newpwd."</b>\n<br><p>";
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "xxxxxxxxx@gmail.com";
$mail->Password = "xxxxxxx";
$mail->SetFrom('xxxxxx@gmail.com', 'Team');
$mail->Subject = "Username & Password Request";
$mail->AltBody = "<br>This email has been automatically generated from an
unmonitored mailbox. Please do not use the reply function.";
$mail->MsgHTML($header);
$address = $data->MEM_EMAIL; // address send to :
$mail->AddAddress($address,"");
$mail->Send();
}else{
echo "<script>alert('Email not exist for this ID : ".$mem_id."');</script>";
}
}


