I'm trying to figure out why my form is not sending when it's in MAMP local host or hosted live on my site. Everything looks right to me but for whatever reason, I'm not getting an email sent to me.
This is my form:
<form action="assets/php/mail.php" method="post">
<div class="row">
<div class="col-md-12">
<input required class="bg-athens-gray px-4" type="text" name="name" aria-required="true" aria-invalid="false" placeholder="First Name" required>
</div><!-- /.col-md-12 -->
<div class="col-md-12">
<input required class="bg-athens-gray px-4" type="email" name="email" aria-required="true" aria-invalid="false" placeholder="Your email address" required>
</div><!-- /.col-md-12 -->
<div class="col-md-12">
<textarea required class="bg-athens-gray px-4" cols="10" rows="4" name="message" aria-required="true" aria-invalid="false" placeholder="Message" required></textarea>
</div><!-- /.col-md-12 -->
<div class="col-md-12">
<input type="submit" value="SEND MESSAGE" class="font-size-14 ltr-sp-2">
</div><!-- /.col-md-12 -->
</div><!-- /.row -->
</form>
This is what's right after the body tag of my mail.php page, which is replicating most of the contact page. I'm using it to confirm that a form has been submitted while keeping the webpage looking the same.
<body>
<?php
$userName = $_POST['name'];
$userEmail = $_POST['email'];
$userMessage = $_POST['message'];
$to = "myemail@websiteaddress.com";
$subject = "Email from contact page";
$body = "Information Submitted:";
$body .= "\r\n Name: " . $userName;
$body .= "\r\n Email: " . $userEmail;
$body .= "\r\n Message: " . $userMessage;
mail($to, $subject, $body);
?>
...