ok
Direktori : /home/importfo/public_html/inddigmedia.in/ |
Current File : /home/importfo/public_html/inddigmedia.in/send_email.php |
<?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL); if (filter_var($email, FILTER_VALIDATE_EMAIL)) { $to = "support@inddigmedia.com"; $subject = "New Newsletter Subscription"; $message = "You have a new newsletter subscription. \nEmail: " . $email; $headers = "From: no-reply@yourwebsite.com"; if (mail($to, $subject, $message, $headers)) { echo "<script> alert('Thank you for subscribing! A confirmation email has been sent.'); window.location.href = 'index.php'; // Redirect to homepage </script>"; } else { echo "<script> alert('There was an issue sending your request. Please try again.'); window.history.back(); </script>"; } } else { echo "<script> alert('Invalid email address. Please enter a valid email.'); window.history.back(); </script>"; } } else { header("Location: index.php"); exit(); } ?>