Answer the question
In order to leave comments, you need to log in
Empty emails when trying to send php mail(). how to fix?
I made a request form on my website
<form action="/mail.php" method="POST" class="contact-form" enctype="multipart/form-data">
<div class="row">
<div class="form-group col-md-6 col-lg-6 col-xl-6">
<input type="text" id="contact_name" name="name" class="form-control" placeholder="Ваше имя" required/>
</div>
<div class="form-group col-md-6 col-lg-6 col-xl-6 tm-col-email">
<input type="email" id="contact_email" name="email" class="form-control" placeholder="E-mail" required/>
</div>
</div>
<div class="form-group">
<textarea id="contact_message" name="message" class="form-control" rows="9" placeholder="Сообщение" required></textarea>
</div>
<button type="submit" class="btn btn-primary tm-btn-submit">Отправить</button>
</form>
<?php
$headers = 'From: Mister-Apple\r\n ';
'Reply-To: Роман\r\n ';
$theme = 'Заказ';
$letter = 'Данные сообщения:\r\n';
$letter .='Имя:'.$_POST['name'].'\r\n';
$letter .='Почта:'.$_POST['email'].'\r\n';
$letter .='Сообщение:'.$_POST['message'].'\r\n';
mail('[email protected]', $theme , $letter );
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question