SMTPDebug = 2; $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPAuth = true; $mail->Username = 'sas.test.2023@gmail.com'; $mail->Password = 'Sas!102938'; $mail->SMTPSecure = "tls"; //PHPMailer::ENCRYPTION_SMTPS; //sender information $mail->setFrom('sas.test.2023@gmail.com', 'Sasana'); // ////receiver email address and name $mail->addAddress('padmanto@gmail.com', 'padmanto'); // // Add cc or bcc // $mail->addCC('email@mail.com'); // $mail->addBCC('user@mail.com'); $mail->isHTML(true); $mail->Subject = 'PHPMailer SMTP test'; $mail->Body = "

PHPMailer the awesome Package

PHPMailer is working fine for sending mail

This is a tutorial to guide you on PHPMailer integration

"; // Send mail if (!$mail->send()) { echo 'Email not sent an error was encountered: ' . $mail->ErrorInfo; } else { echo 'Message has been sent.'; } // $mail->smtpClose(); } }