To make a long story short ive spent the best of the past few days trying to find a bypass to a current issue I have with an Inhouse website. I need to create a submission form that will take user input and send it in an email (Or something that can notify people VIA email about a submission that gets stored) This is a IIS webpage that was setup many years ago mostly relying on static HTML pages and some CSS for basic layouts. Ive tried using things like a PHP submission form but I cant seem to get it to send the email out Ive also tried EmailJS but it is considered a security threat for the Organization I am working with.
Ive attached some code below but in reality I need more that just code as I dont know a way around it.
<?php
    if(isset($_POST['submit'])){
        $name=$_POST['name'];
        $email=$_POST['email'];
        $phone=$_POST['phone'];
        $msg=$_POST['msg'];
        $to=''; // Receiver Email ID, Replace with your email ID
        $subject='Form Submission';
        $message="Name :".$name."\n"."Phone :".$phone."\n"."Wrote the following :"."\n\n".$msg;
        $headers="From: ".$email;
        if(mail($to, $subject, $message, $headers)){
            echo "<h1>Sent Successfully! Thank you"." ".$name.", We will contact you shortly!</h1>";
        }
        else{
            echo "Something went wrong!";
        }
    }
?>
Above is just a basic PHP script that I was attempting to use to send the email but being as this is IIS It doesnt seem to work - I know there is a way around this but all the ways ive attempted havent seemed to work.
If anyone can give assistance on using a automatic email system for a user submission form from IIS it would be helpful.
