☜
☞
Email requires two things, mail to send the form and form to process the inputs. Mail requires email, subject, message and from email to send the email. And those the inputs require at the inputs.
<?php
if($_POST){
mail('info@lokang.com', 'email from website', $_POST['message'], [
'From' => $_POST['email']
]);
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>email | Lokang</title>
</head>
<body>
<header></header>
<form action="" method="post">
<p>
<label for="name" class="form-label">Name</label>
<input name="name" type="text" id="name" class="form-control" required>
</p>
<p>
<label for="email" class="form-label">email</label>
<input name="email" id="email" type="text" class="form-control" required>
</p>
<p>
<label for="message" class="form-label">message</label>
<textarea name="message" id="message" class="form-control"></textarea>
</p>
<button class="btn btn-secondary mt-2" type="submit">submit</button>
</form>
<footer>
© Lokang <?php echo date("Y") ?>
</footer>
</body>
</html>
☜
☞