isSMTP(); $mail->Host = 'smtp.gmail.com'; //SMTP server $mail->SMTPAuth = true; $mail->Username = ''; //email address $mail->Password = ''; // app password $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Port = 587; $mail->setFrom('', 'Innova'); $mail->addAddress("{$address}"); $mail->Subject = $subject; $mail->Body = $body; $mail->send(); echo 'Message has been sent'; } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } } ?>