/
/
home
/
u523034047
/
domains
/
josanfishfarmsolutions.com
/
public_html
Server: in-mum-web1112.main-hosting.eu (62.72.28.111)
You: 216.73.216.52
PHP 8.3.16
Dir:
/home/u523034047/domains/josanfishfarmsolutions.com/public_html
Edit:
/home/u523034047/domains/josanfishfarmsolutions.com/public_html/mail1.php
<?php if($_SERVER["REQUEST_METHOD"] == "POST") { // Collect form data $name = htmlspecialchars($_POST['your-name']); $email = htmlspecialchars($_POST['your-email']); $mobile = htmlspecialchars($_POST['mobile']); $subject = htmlspecialchars($_POST['your-subject']); $message_content = htmlspecialchars($_POST['your-message']); // Debugging (to check values) echo "<h3>Form Data Received:</h3>"; echo "Name: " . $name . "<br>"; echo "Email: " . $email . "<br>"; echo "Subject: " . $subject . "<br>"; echo "Message: " . nl2br($message_content) . "<br>"; // ----------- TESTING ONLY ----------- // exit; // remove comment to stop before sending email // ----------------------------------- // Recipient email $to = "harish8313@gmail.com"; $subject = "Online Enquiry Details From Joshan fish solutions"; $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($message_content)) . '</td></tr> </table> </body> </html> '; $headers = "From: info@gurpreettraders.com\r\n"; $headers .= "Cc: info@gurpreettraders.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=UTF-8\r\n"; error_reporting(E_ALL); ini_set("display_errors", 1); if (mail($to, $subject, $message, $headers)) { echo "<script>alert('Your enquiry has been submitted successfully.'); window.location.href='contact-us.php';</script>"; } else { echo "Mail Failed<br>"; print_r(error_get_last()); // echo "<script>alert('Error: Message could not be sent. Please try again later.'); window.location.href='contact-us.php';</script>"; } } else { echo "Invalid request."; } ?>
Ukuran: 2.4 KB