I need to send e-mail using data from the form (mailto doesn`t work)
Somehow, php file doesn't connect to html. When I run index.html
locally, if I push submit, the browser shows me a php code and doesn't do anything else. When I use localhost
, it throws a 405 Error
if I push submit.
PLS help since i am not php dev.
<form method="POST" name="myName" action="registration.php">
<textarea name="message"></textarea>
<div class="form_submit">
<input type="submit" value="Submit" class="form_submit-btn">
</div>
</form>
<?php
if($_POST["message"]) {
mail("myemail@gmail.com", "Here is the subject line",
$_POST["insert your message here"]. "From: an@email.address");
}
?>