alert('Please complete the form and try again.'); window.history.back();";
exit;
}
$recipient = "singhjeet4874@gmail.com"; // Your email
$mail = new PHPMailer(true);
try {
// SMTP settings
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'sspappkee@gmail.com';
$mail->Password = 'pkqwvwbjsunljqpg'; // Use an App Password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
// Email content
$mail->setFrom('sspappkee@gmail.com');
$mail->addAddress($recipient);
$mail->isHTML(true);
$mail->Subject = "New Query";
$mail->Body = "Name: $name
Email: $email
Number: $number
Service Needed: $occasion
Address: $address
Message:
$message
"; $mail->send(); // Success Alert echo ""; exit; } catch (Exception $e) { http_response_code(500); echo ""; } } else { http_response_code(403); echo ""; } ?>