Hi all. I am just about to finish a project i have been working on, but i would like the contact form to work. It needs to send the information a user has asked me to my email address. Please help me.
<form method="post" name="caitlynf65@gmail.com" action="form-to-email.php">
<div class="conatct-container">
<h2>Contact Me Now!</h2>
<input type="name"
class="contact-input"
placeholder="Your name">
<input type="email"
class="contact-input"
placeholder="E-mail address">
<textarea class="message"
placeholder="Type your message here..."></textarea>
<input type="submit"
class="contact-submit"
value="Submit"/>
</div>
</form>
<?php
if(isset($_POST['submit'])){
$name=$_POST['name'];
$email=$_POST['email'];
$msg=$_POST['message'];
$to='ca@gmail.com';
$subject='Form Submission';
$message="Name :".$name."\n"."\n"."Wrote the following :"."\n\n".$message;
$headers="From: ".$email;
if(mail($to, $subject, $message, $headers)){
echo "<h1>Sent Successfully! Thank you"." ".$name.", I will contact you shortly!</h1>";
}
else{
echo "Something went wrong!";
}
}
?>