'Contact Form', "Name" => $name, "Email" => $email, "Phone" => $phone, "Message" => $message, "Device" => $device, "IP Address" => $ipAddress, "Location" => $location, ]; // Build HTML email content $htmlBody = "
Imaging World

New Contact Inquiry Received

A user has submitted a contact request through the Imaging World website.

Full Name $name
Email Address $email
Phone Number $phone
Message $message
Device $device
IP Address $ipAddress
Location $location
© Imaging World | Advanced Medical Imaging Solutions
www.imagingworld.in
"; $to = "imagingworld9@gmail.com"; $subject = "New Inquiry Received | Imaging World"; $from = "noreply@imagingworld.in"; $separator = md5(time()); $eol = "\r\n"; $headers = "From: Imaging World <{$from}>" . $eol; $headers .= "Reply-To: sahil@clientsnow.co.in" . $eol; $headers .= "Bcc: leads@clientsnow.co.in" . $eol; $headers .= "MIME-Version: 1.0" . $eol; $headers .= "Content-Type: multipart/mixed; boundary=\"" . $separator . "\"" . $eol . $eol; $body = "--" . $separator . $eol; $body .= "Content-Type: text/html; charset=\"UTF-8\"" . $eol; $body .= "Content-Transfer-Encoding: 7bit" . $eol . $eol; $body .= $htmlBody . $eol . $eol; $body .= "--" . $separator . "--" . $eol; // ---------- reCAPTCHA ---------- $recaptcha_secret = '6Lck9v0pAAAAAOIpslVwP-yLjORR0r0N_tQMTZ5D'; $recaptcha_response = $_POST['google-recaptcha-response'] ?? ''; $verifyUrl = 'https://www.google.com/recaptcha/api/siteverify'; $verifyCtx = stream_context_create([ 'http' => [ 'method' => 'POST', 'content' => http_build_query(['secret' => $recaptcha_secret, 'response' => $recaptcha_response]) ] ]); $verifyRes = file_get_contents($verifyUrl, false, $verifyCtx); $result = json_decode($verifyRes); // === SEND TO GOOGLE SHEET === $webhook_url = "https://script.google.com/macros/s/AKfycbxr4mE-xftZscDgslutrQUNBFQhh-Qi5-Ni6QGNV6wDrHnzHpjEtq0CdGHEngbA8JVo/exec"; $options = [ "http" => [ "header" => "Content-type: application/json", "method" => "POST", "content" => json_encode($formdata) ] ]; @file_get_contents($webhook_url, false, stream_context_create($options)); if (mail($to, $subject, $body, $headers)) { if (!empty($email)) { $thankyouSubject = "Thank You for Your Inquiry | Imaging World"; $thankyouHeaders = "MIME-Version: 1.0" . $eol; $thankyouHeaders .= "Content-type:text/html;charset=UTF-8" . $eol; $thankyouHeaders .= "From: Imaging World " . $eol; $thankyouHeaders .= "Reply-To: sahil@clientsnow.co.in" . $eol; $thankyouBody = "
Imaging World

Thank You, $name 👋

Thank you for contacting Imaging World. We have successfully received your inquiry and our team will review your message and get in touch with you shortly.

Your Submitted Details:

Name $name
Email $email
Phone $phone
Message $message

About Imaging World

Imaging World is dedicated to delivering advanced medical imaging solutions, including diagnostic equipment, imaging systems, and healthcare technology services. We support healthcare providers with reliable solutions that enhance diagnostic accuracy and patient care.

💬 Chat on WhatsApp 🌐 Visit Our Website 📞 Contact Details

One of our representatives will reach out to you within 24 working hours.

Warm regards,
Team Imaging World

© Imaging World | Advanced Medical Imaging Solutions
Website & Email System by Clients Now Technologies
"; @mail($email, $thankyouSubject, $thankyouBody, $thankyouHeaders); } header("Location: thankyou"); exit; } else { header("Location: contact-us"); exit; } }