Estoy haciendo un formulario para enviar un email a una direccion predefinida pero me da error, códigos:
formulario.php
<html>
<body>
<form action="enviar_c.php" method="post">
<table width="200" heicht="200" border="0">
<tr>
<td>Asunto:</td>
<td><input type="text" name="asunto" /></td>
</tr>
<tr>
<td>Desde:</td>
<td><input type="text" name="desde" /></td>
</tr>
<tr>
<td>Mensaje:</td>
<td><textarea name="mensaje"></textarea></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="enviar correo" /></td>
</tr>
</table>
</body>
</html>
enviar_c.php:
<?php
if(isset($_POST['asunto']) && !empty($_POST['asunto']) && isset($_POST['desde']) && !empty($_POST['desde']) && isset($_POST['mensaje']) && !empty($_POST['mensaje'])) {
$destinatario = "(noquieroponerelemail)";
$asunto = $_POST['asunto'];
$mensaje = $_POST['mensaje'];
mail($destinatario,$asunto,$mensaje);
echo "correro enviado";
}else{
echo "correro no enviado";
}
?>
El error es el siguiente:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing