I am a novice to php but go code from the web and had edited it. The form is a contact form on my website and is supposed to send me an email. But after the edit, it is unable to email me after several tries.
HTML FORM
<h3>Use This Contact Form To Reach Us</h3>
<form action="thankyou.php" method="post">
<input type="text" name="name" id="name" maxlength="30" placeholder="Full Name">
<input type="email" name="email" id="email" maxlength="50" placeholder="Email">
<input type="text" name="phone" id="phone" maxlength="10" placeholder="Phone">
<textarea placeholder="Message" name="message" id="message"></textarea>
<input type="submit" id="submit" value="Submit">
</form>
This is the php page.
thankyou.php
<?php
if ($_POST["submit"]) {
$recipient = "marketing@smartpay.com";
$subject = "MESSAGE FROM ONLINESMARTPAY.COM";
$sendername = $_POST["name"];
$senderemail = $_POST["email"];
$senderphone = $_POST["phone"];
$message = $_POST["message"];
$mailBody = "FullName: $sendername\nEmailAddress: $senderemail\nPhoneNumber:
$senderphone\n\n$message";
mail($recipient, $subject, $mailBody, "From: $sender <$senderemail>");
}
?>