isSMTP(); $mail->Host = 'smtp.gmail.com'; // Replace with your SMTP server $mail->SMTPAuth = true; $mail->Username = 'sspappkeys@gmail.com'; // Replace with your email $mail->Password = 'momcjmfzwcfastuu'; // Replace with your email password $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Use TLS encryption $mail->Port = 587; // Usually 587 for TLS, 465 for SSL // Email Headers $mail->setFrom('sspappkeys@gmail.com', 'Enquiry Form'); // Replace with your email and name $mail->addAddress('jeet36686@gmail.com', 'Admin'); // Replace with recipient email // Email Content $mail->isHTML(true); $mail->Subject = 'New Enquiry'; $mail->Body = "

Contact Form Submission

First Name: $fname

Last Name: $lname

Email: $email

Phone: $phone

Message: $message

"; // Send Email if ($mail->send()) { echo "Email sent successfully!"; } else { echo "Failed to send email."; } } catch (Exception $e) { echo json_encode(["status" => "error", "message" => "Mailer Error: " . $mail->ErrorInfo]); } } else { echo json_encode(["status" => "error", "message" => "Invalid Request"]); } ?>