isSMTP();
$mail->Host = 'smtp.gmail.com'; // Change this based on your email provider
$mail->SMTPAuth = true;
$mail->Username = 'sspappkee@gmail.com'; // Your SMTP email
$mail->Password = 'pkqwvwbjsunljqpg'; // Your SMTP password (use App Passwords for security)
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
// Recipients
$mail->setFrom('sspappkee@gmail.com');
$mail->addAddress($recipient);
// Content
$mail->isHTML(true);
$mail->Subject = "New Query";
$mail->Body = "Name: $name
Email: $email
Number: $number
Message: $msg
";
$mail->send();
http_response_code(200);
echo
'';
} catch (Exception $e) {
http_response_code(500);
echo "Error: Could not send email. Mailer Error: {$mail->ErrorInfo}";
}
} else {
http_response_code(403);
echo "There was a problem with your submission. Please try again.";
}
?>