Использую phpmailer
html:
<form action="block/mail.php" method="post">
<div class="inputs">
<ul>
<li>Фамилия:<br><input type="text" id="last_name" name="last_name"></li>
<li">Имя:<br><input type="text" id="first_name"></li>
<li>Телефон:<br><input type="text" id="phone" name="phone"></li>
<li">E-mail:<br><input type="text" id="email" name="email"></li>
<button type="submit">Отправить</button>
</ul>
</div>
</form>
php:
<?php
require 'class.phpmailer.php';
$lname = $_POST['last_name'];
$fname = $_POST['first_name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$mail = new PHPMailer;
$mail->From = '[email protected]';
$mail->FromName = 'Testname';
$mail->AddAddress('[email protected]');
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Body = "Name: $lname";
$mail->Send();
?>