/
/
home
/
u523034047
/
domains
/
gmcrudrapur.com
/
public_html
Server: in-mum-web1112.main-hosting.eu (62.72.28.111)
You: 216.73.216.4
PHP 8.3.16
Dir:
/home/u523034047/domains/gmcrudrapur.com/public_html
Edit:
/home/u523034047/domains/gmcrudrapur.com/public_html/mail.php
<?php include('admin/conn.php'); if (isset($_POST['submit'])) { $name = mysqli_real_escape_string($connection, $_POST['name']); $email = mysqli_real_escape_string($connection, $_POST['email']); $mobile = mysqli_real_escape_string($connection, $_POST['mobile']); $description = mysqli_real_escape_string($connection, $_POST['description']); // Insert into database $sql = "INSERT INTO send_message (Name, email, mobile, message) VALUES ('$name', '$email', '$mobile', '$description')"; mysqli_query($connection, $sql); // Email setup $to = 'principalgmcrudrapur@gmail.com'; // $to = 'harish8313@gmail.com'; $subject = "Online Enquiry Details From gmcrudrapur.com"; $message = ' <html> <head> <style> body { font-family: Arial, sans-serif; color: #333; } table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 8px; border-bottom: 1px solid #ddd; } th { background-color: #f2f2f2; } </style> </head> <body> <h2>New Online Enquiry Received</h2> <table> <tr><th>Name</th><td>' . htmlspecialchars($name) . '</td></tr> <tr><th>Email</th><td>' . htmlspecialchars($email) . '</td></tr> <tr><th>Mobile No</th><td>' . htmlspecialchars($mobile) . '</td></tr> <tr><th>Message</th><td>' . nl2br(htmlspecialchars($description)) . '</td></tr> </table> <p>Regards,<br><strong>GMC Rudrapur</strong></p> </body> </html> '; $headers = "From: info@gmcrudrapur.com\r\n"; $headers .= "Cc: info@gmcrudrapur.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=UTF-8\r\n"; if (mail($to, $subject, $message, $headers)) { echo "<script>alert('Your enquiry has been submitted successfully.'); window.location.href='contact-us.php';</script>"; } else { echo "<script>alert('Error: Message could not be sent. Please try again later.'); window.location.href='contact-us.php';</script>"; } } ?>
Ukuran: 2.1 KB