diff --git a/mailBooking.php b/mailBooking.php
new file mode 100644
index 0000000..3d7f47d
--- /dev/null
+++ b/mailBooking.php
@@ -0,0 +1,264 @@
+
+isSMTP();
+ $userMail->Host = 'smtp.gmail.com';
+ $userMail->SMTPAuth = true;
+ $userMail->Username = 'noreply.nclex.email@gmail.com';
+ $userMail->Password = 'gmbe nypd ofcl vpmi';
+ $userMail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
+ $userMail->Port = 587;
+
+ // User Email Configuration
+ $userMail->setFrom('noreply.nclex.email@gmail.com', $support_name);
+ $userMail->addAddress($user_email);
+ $userMail->isHTML(true);
+ $userMail->Subject = "Thank you for contacting ". $support_name;
+
+ // Embed logo
+ $userMail->addEmbeddedImage('img/logo/logo-trans.png', 'logo_cid');
+
+ // User Email Template (Responsive & clean design)
+ $userMail->Body = <<
+
+
+
+
Booking Confirmation
+
+
+
+
+
+
+
Dear {$name},
+
Thank you for reaching out to $support_name. We have received your booking request. Below are your booking details:
+
+
Booking Details
+
Car Name: {$car_name}
+
Drop-off Location: {$location}
+
Pickup Date: {$pickup_date}
+
Drop-off Date: {$dropoff_date}
+
+
Our team will contact you shortly to confirm your booking and provide further details.
+
If you have any questions, please reply to this email.
+
Best regards,
$support_name Team
+
+
If you didn't initiate this booking, please ignore this email. This may have been sent in error.
+
+
+
+
+HTML;
+
+ /*** Admin Notification Email ***/
+ $adminMail = new PHPMailer(true);
+
+ // SMTP Configuration
+ $adminMail->isSMTP();
+ $adminMail->Host = 'smtp.gmail.com';
+ $adminMail->SMTPAuth = true;
+ $adminMail->Username = 'noreply.nclex.email@gmail.com';
+ $adminMail->Password = 'gmbe nypd ofcl vpmi';
+ $adminMail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
+ $adminMail->Port = 587;
+
+ $adminMail->setFrom('noreply.nclex.email@gmail.com', $support_name);
+ $adminMail->addAddress($company_email);
+ $adminMail->addReplyTo($user_email, $name);
+ $adminMail->isHTML(true);
+ $adminMail->Subject = "New Booking Request: {$subject}";
+
+ // Embed logo for admin email
+ $adminMail->addEmbeddedImage('img/logo/logo-trans.png', 'logo_cid');
+
+ $currentDateTime = date('Y-m-d H:i:s');
+
+ // Admin Email Template (all details nicely presented)
+ $adminMail->Body = <<
+
+
+
+
New Booking Request
+
+
+
+
+
+
+
+
Booking Information
+
Full Name: {$name}
+
Email: {$user_email}
+
Phone Number: {$phone}
+
Car Name: {$car_name}
+
Drop-off Location: {$location}
+
Pickup Date: {$pickup_date}
+
Drop-off Date: {$dropoff_date}
+
Subject: {$subject}
+
Message:
{$message}
+
+
+
+
+
+
+HTML;
+
+ // Send the emails
+ $userMail->send();
+ $adminMail->send();
+
+ // Redirect back to the referring page with a success status
+ $redirectUrl = buildRedirectUrl('success');
+ header("Location: $redirectUrl");
+ exit();
+
+ } catch (Exception $e) {
+ // On error, encode the message and redirect back with the error status
+ $errorMessage = "&message=" . urlencode($e->getMessage());
+ $redirectUrl = buildRedirectUrl('error', $errorMessage);
+ header("Location: $redirectUrl");
+ exit();
+ }
+
+ } else {
+ // Missing fields: redirect back with missing_fields status
+ $redirectUrl = buildRedirectUrl('missing_fields');
+ header("Location: $redirectUrl");
+ exit();
+ }
+}
+
+// Include header after potential redirects
+include('header.php');
+
+// Handle status messages (this part is optional if you want to display messages on the referring page)
+if (isset($_GET['status'])) {
+ switch ($_GET['status']) {
+ case 'success':
+ echo "
✅ Your message has been sent successfully!
";
+ break;
+ case 'error':
+ $error = isset($_GET['message']) ? htmlspecialchars($_GET['message']) : "There was an error sending your message. Please try again.";
+ echo "
❌ $error
";
+ break;
+ case 'missing_fields':
+ echo "
⚠️ Please fill in all the required fields.
";
+ break;
+ }
+}
+?>
\ No newline at end of file
diff --git a/mail.php b/mailContact.php
similarity index 96%
rename from mail.php
rename to mailContact.php
index 4cfbca2..3a0c00e 100644
--- a/mail.php
+++ b/mailContact.php
@@ -1,13 +1,8 @@
+
Port = 587;
// User Email Configuration
- $userMail->setFrom('noreply.nclex.email@gmail.com', 'NCLEX Support');
+ $userMail->setFrom('noreply.nclex.email@gmail.com', $support_name);
$userMail->addAddress($user_email);
$userMail->isHTML(true);
- $userMail->Subject = "Thank you for contacting NCLEX Support";
+ $userMail->Subject = "Thank you for contacting " . $support_name;
// Embed logo
$userMail->addEmbeddedImage('img/logo/logo-trans.png', 'logo_cid');
@@ -63,6 +58,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+
@@ -105,7 +101,7 @@ HTML;
$adminMail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$adminMail->Port = 587;
- $adminMail->setFrom('noreply.nclex.email@gmail.com', 'NCLEX Support');
+ $adminMail->setFrom('noreply.nclex.email@gmail.com', $support_name);
$adminMail->addAddress($company_email);
$adminMail->addReplyTo($user_email, $name);
$adminMail->isHTML(true);
@@ -134,6 +130,7 @@ HTML;
+
@@ -213,7 +210,6 @@ if (isset($_GET['status'])) {
case 'missing_fields':
header("Location: contact.php?status=missing_fields");
exit();
-
}
}
-?>
\ No newline at end of file
+?>
diff --git a/mailCredentials.php b/mailCredentials.php
new file mode 100644
index 0000000..31a87fb
--- /dev/null
+++ b/mailCredentials.php
@@ -0,0 +1,7 @@
+Request for Booking
Fil your requirement to us. We will check your request and contact you soon.
-
+
@@ -33,71 +31,79 @@
@@ -191,4 +198,4 @@
-
+
\ No newline at end of file