I have been looking for over a week for a contact form that is not too complicated to understand and create.
I finally found this contact form that seemed to be simple and easy to understand with HTML and PHP.
The issue is that once i click the submit button the email never arrived to my personal email on gmail.
The goal: Create a working contact form with HTML and PHP
The issue: Email never arrived when submitted
I would really appreciate if someone could help me out indicating what the problem could be and how to fix it, thank you!
The form is divided into three parts, here is my code -->
contact.php :
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact Form</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<form action="thankyou.php" method="post">
Name <input type="text" name="fullname">
Email <input type="text" name="email">
Message <textarea name="message"></textarea>
<input type="submit" value="Send">
</form>
</body>
</html>
thankyou.php :
<?
$name = $_POST['fullname'];
$email = $_POST['email'];
$message = $_POST['message'];
$email_message = "
Name: ".$name."
Email: ".$email."
Message ".$message."
";
mail("myemail@gmail.com" , "New inquiry" , $email_message);
header("Location: email_success.php");
?>
email_success.php :
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Email Sent</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1>Email sent</h1>
</body>
</html>