I have tried to resolve the issue myself (and some websites and questions here in Stockoverflow), but without success.
My problem is I'm trying to make my form actually send an email to the specified address down there, but it is absolutely not working. Any idea where my code is bugging?
here is a piece of it, can you see any mistake?
Thanks!
<?php
if(isset($_POST['submit'])){
$to = "email@gmail.com"; // this is my Email address
$from = $_POST['email']; // this is the sender's Email address
$first_name = $_POST['name'];
$subject = "Form submission";
$subject2 = "Copy of your form submission";
$message = $first_name . " " . " wrote the following:" . "\n\n" . $_POST['message'];
$message2 = "Here is a copy of your message " . $first_name . "\n\n" . $_POST['message'];
$headers = "From:" . $from;
$headers2 = "From:" . $to;
mail($to,$subject,$message,$headers);
mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
}
?>
<body id="getademo">
<div class="titlepage">
<h1 id="introdemo">GET IN TOUCH</h1>
<p id="mikshahf">We will get back to you soon!</p>
</div>
<div id="form1">
<div id="formform">
<form>
<p>
<input name="name" type="text" class="feedback-input" placeholder="Name" id="name" />
</p>
<p>
<input name="email" type="text" class="feedback-input" id="email" placeholder="Email" />
</p>
<p>
<textarea name="message" class="feedback-input" id="comment" placeholder="Message"></textarea>
</p>
<div class="submit">
<input name="submit" type="submit" value="SEND" id="button-blue"/>
</div>
</form>
</div>
</div>
</body>