isSMTP(); $userMail->Host = 'smtp.gmail.com'; $userMail->SMTPAuth = true; $userMail->Username = $sending_email; $userMail->Password = $app_password; $userMail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $userMail->Port = 587; // User Email Configuration $userMail->setFrom($sending_email, $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 = <<
Dear {$name},
Thank you for reaching out to $support_name. We have received your booking request. Below are your 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.
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}
✅ 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; } } ?>