Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/11/2009, 19:49
hicolu
 
Fecha de Ingreso: agosto-2009
Ubicación: Lima
Mensajes: 226
Antigüedad: 14 años, 8 meses
Puntos: 3
correo por php

Hola Lista, tengo un problema al enviar un correo desde php.
Sucede que de mi localhost si envio sin problema pero cuando lo subo a mi hosting que por cierto es gratis me sale un error haber si alguien me da una mano en esto que ya estoy desde ayer con este rollo.

contactos.html

<html>

<head>


</head>

<body background-color: #BC8F8F >

<h1 id="logo"> Consultorias Sig <span></span></h1>

<h2>
<div id="tabsF">
<ul>
<li><a href="index.html" title="Pagina Principal"><span>Inicio</span></a></li>
<li><a href="servicios.html" title="Servicios que ofrecemos"><span>Servicios</span></a></li>
<li><a href="clientes.html" title="Clientes mas importantes"><span>Clientes</span></a></li>
<li><a href="contactos.html" title="Comuniquese con nosotros"><span>Cont&aacute;ctenos </span></a></li>

</ul>
</div>
</h2>



<div id="contec">
<div id="contacto1" >


<form name="frm" method="post" action="envio.php">
<fieldset id="form">
<legend>Envienos su Mensaje</legend>

<ol>
<li><label>Nombre: </label><input type="text" name="nombre" size="60" value ="Maria Cardenas Gauuu"/></li>
<li><label>Direcci&oacute;n: </label><input type="text" name="direccion" size="60" value ="ubicatishosss"/></li>
<li><label>E-mail: </label><input type="text" name="email" size="60" value ="mcardenas69ARROBAhotmail.com" /></li>
<li><label>Telefono: </label><input type="text" name="telefono" size="25" value ="Telejono"/></li>
<li><label>Empresa: </label><input type="text" name="empresa" size="60" value ="Empressssa"/></li>
<li><label>Ciudad: </label><input type="text" name="ciudad" size="60" value ="Cidudad"/></li>
<li><label>Comentarios: </label>
<textarea name="mensaje" rows="3" cols="60">Escribe aqu&iacute; tus comentarios</textarea> </li>
<!-- <input type="text" name="fcomentarios" size="25" /></li>

id="textarea_comunicacion"
-->
</ul>
<p align="center"><input type="submit" name="submit" class="btn" value="Enviar" /></p>
</fieldset>

</FORM>

<!-- <div style="background: url(/images/menus.png) no-repeat;width:540px;height:499px"> -->



</div>





<div id="datos" >
Copyright &copy; 2009 Consultoria SIG - Peru
</div>
</div>


</body>

</html>




envio.php

<?php

// definimos las variables o marcamos el error
if ( !empty($_POST['nombre']) ) { $nombre = $_POST['nombre']; } else {$error = true;}
if ( !empty($_POST['direccion']) ) { $direccion = $_POST['direccion']; } else {$error = true;}
if ( !empty($_POST['email']) ) { $email = $_POST['email']; } else {$error = true;}
if ( !empty($_POST['telefono'])) { $telefono = $_POST['telefono']; } else {$error = true;}
if ( !empty($_POST['empresa']) ) { $empresa = $_POST['empresa']; } else {$error = true;}
if ( !empty($_POST['ciudad']) ) { $ciudad = $_POST['ciudad']; } else {$error = true;}
if ( !empty($_POST['mensaje']) ) { $mensaje = $_POST['mensaje']; } else {$error = true;}


// verificamos que no exista un error
if ( !empty($error) ) {
header( 'Location: contacto_error.php' );
die;
}



// definimos el cuerpo del email

$cuerpo = "Formulario enviado\n";
$cuerpo .= "Nombre: " . $nombre . "\r\n";
$cuerpo .= "Email: " . $email . "\r\n";
$cuerpo .= "Direccion: " . $direccion . "\r\n";
$cuerpo .= "Telefono: " . $telefono . "\r\n";
$cuerpo .= "Empresa: " . $empresa . "\r\n";
$cuerpo .= "Ciudad: " . $ciudad . "\r\n";
$cuerpo .= "Comentarios: " . $mensaje . "\r\n";




// enviamos el email
if ( mail( 'lhilarioARROBAarenaverde.com.pe', 'Recibiste un mensaje a través del formulario de contacto de tu sitio', utf8_decode($cuerpo) )) {
header( 'Location: contacto_exitoso.php' );
die;
} else {
header( 'Location: contacto_error.php' );
die;
}
?>


GRACIAS POR SUS RESPUESTAS