Creas un contacto.php y le pones:
Código PHP:
if(isset($_POST['submit'])){
if (empty($_POST['nombre']) || empty($_POST['apellido']) || empty($_POST['direccion']) || empty($_POST['email']) || empty($_POST['tel']) || empty($_POST['mensaje'])) {
echo 'te falto algo'
}else{
$para = "tuemail@tuemail";
$asunto = $_POST['nombre'].' '.$_POST['apellido'].'te envia un mensaje';
$mensaje = $_POST['nombre'].' de '.$_POST['direccion'].' telefono '.$_POST['tel'].' te envia el siguiente mensaje'."\n".$_POST['mensaje'];
$de = "From: $_POST['email'] \r\n";
if (mail($para,$asunto,$mensaje,$de)){
echo 'Gracias por tu mensaje';
}else{
echo 'Ha ocurrido un error';
}
}
}else{
?>
<form action="contacto.php" method="post">
Tu nombre:<input type="text" name="nombre" />
Apellido:<input type="text" name="apellido" />
Direccion:<input type="text" name="direccion" />
Tu e-mail:<input type="text" name="email" />
Telefono: <input type="text" name="tel" />
<textarea cols="40" rows="5" name="mensaje"></textarea>
<input type="submit" name="submit" value="Enviar" />
</form>
<?}?>