$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.gmail.com";
$mail->Username = "[email protected]";
$mail->Password = "password";
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->SetFrom("[email protected]");
$mail->AddAddress($cash[0]['email']);
$mail->isHTML(true);
$mail->Subject = "CS50 Apparels: You just bought an item!";
$mail->Body = "You just bought".$row['suit_name']."for".$row['price']."dollars!";
$mail->AltBody = "You just bought".$row['suit_name']."for".$row['price']."dollars!";
if ($mail->Send() == false)
{
die($mail->ErrorInfo);
}
I fixed my previous issues, but now I'm getting an error: "The following From address failed: [email protected] The following From address failed: [email protected] SMTP server error: 5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/answer/14257 79sm22609146pfs.42 - gsmtp" I tried checking out the link, but it's not the answer to my question.