Muchas gracias, me acaban de constestar lo mismo el soporte de dattatec. Y me dijeron que agregue una linea:
ini_set(sendmail_from, '
[email protected]')
Pero ahora me tira otro error:
Parse error: syntax error, unexpected T_IF in \\hmfsw\web\DTCWIN108\centroficch.com.ar\public_ht ml\contacto.php on line 208
La linea 208 es:
if(mail($dest,$asunto,$cuerpo,$headers)){
El código completo:
Código PHP:
Ver original<?php
if(isset($_POST['boton'])){ if($_POST['nombre'] == ''){
$errors[1] = '<span class="error">Ingrese su nombre</span>';
}else if($_POST['email'] == '' or
!preg_match("/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/",$_POST['email'])){ $errors[2] = '<span class="error">Ingrese un email correcto</span>';
}else if($_POST['asunto'] == ''){
$errors[3] = '<span class="error">Ingrese un asunto</span>';
}else if($_POST['mensaje'] == ''){
$errors[4] = '<span class="error">Ingrese un mensaje</span>';
}else{
$nombre = $_POST['nombre'];
$email = $_POST['email'];
$asunto = $_POST['asunto']; //Asunto
$cuerpo = $_POST['mensaje']; //Cuerpo del mensaje
//Cabeceras del correo
$headers = "From: $nombre $email \r\n"; //Quien envia?
$headers .= "X-Mailer: PHP5 \r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; //
if(mail($dest,$asunto,$cuerpo,$headers)){ $result = '<div class="result_ok">Email enviado correctamente </div>';
// si el envio fue exitoso reseteamos lo que el usuario escribio:
$_POST['nombre'] = '';
$_POST['email'] = '';
$_POST['asunto'] = '';
$_POST['mensaje'] = '';
}else{
$result = '<div class="result_fail">Hubo un error al enviar el mensaje </div>';
}
}
}
?>
<form class='contacto' method='POST' action=''>
<div><label>Tu Nombre:</label><input type='text' class='nombre' name='nombre' value='<?php echo @$_POST['nombre']; ?>'><?php echo @$errors[1] ?></div>
<div><label>Tu Email:</label><input type='text' class='email' name='email' value='<?php echo @$_POST['email']; ?>'><?php echo @$errors[2] ?></div>
<div><label>Asunto:</label><input type='text' class='asunto' name='asunto' value='<?php echo @$_POST['asunto']; ?>'><?php echo @$errors[3] ?></div>
<div><label>Mensaje:</label><textarea rows='6' class='mensaje' name='mensaje'><?php echo @$_POST['mensaje']; ?></textarea><?php echo @$errors[4] ?></div>
<div><input type='submit' value='ENVIAR MENSAJE' class='boton' name='boton'> <input type='reset' value='BORRAR INFORMACIÓN' class='boton' name='boton2'></div>
<?php echo @$result; ?>
</form>
No veo ningún error de sintaxis, ustedes?
EDIT: Ya lo solucione jaja me faltaba un ";" despues del ini_set