0

I'm trying to solve this really hard, I looked into tutorials, I've read every single post here and I tried everything to make simple contact form work, but unfortunately it doesn't. I have my form designed, I make PHP file , I followed every step, but again nothing. I would appreciate if someone helps me and solve me that big problem.

<div class="contactCol contactForm">
<form class="myForm" action="mail.php" method="POST">
<div class=contactRow>
<input class=name name="First Name" type=text placeholder="First Name" required />
<input type=text name="Last Name" placeholder="Last Name" required />
</div>
<div class=contactRow>
<input class=e-mail name=Email type=email placeholder="Email Adress" required />
<input type=tel name=Number placeholder="WhatsApp Number" required />
</div>
<div class=contactRow>
<textarea name=Message rows=8 cols=80 placeholder=Message... required /></textarea>
</div>
<div class=buttonDiv>
<button class=button name="Submit" type=submit>submit</button>
<span></span>
</div>
</form>
</div>


PHP CODE HERE :

 <?php
if(isset($_POST['Submit'])){
    $to = "nemanjabbf@gmail.com"; // this is your Email address
    $from = $_POST['Email']; // this is the sender's Email address
    $first_name = $_POST['First Name'];
    $last_name = $_POST['Last Name'];
    $phone = $_POST['Number'];
    $mail = $_POST['Email'];
    $text = $_POST['Message'];
    $subject = "Pristine Fresh - Contact Us";
    $message = $first_name . " " . $last_name . " $phone . " " . $mail . " " . $text . " " . ;

    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);
    header('Location: thank-you.html')
    }
?>
Nexibald
  • 11
  • 1
  • `$from = $_POST['Email']; // this is the sender's Email address` - that's an absolute no-no, email service providers do not like it when you pretend to be sending emails "from" someone else's account. – CBroe Sep 15 '21 at 07:42

0 Answers0