Ver Mensaje Individual
  #3 (permalink)  
Antiguo 31/01/2003, 19:46
Avatar de ccesarcv
ccesarcv
 
Fecha de Ingreso: enero-2003
Ubicación: México, D.F.
Mensajes: 35
Antigüedad: 21 años, 2 meses
Puntos: 0
Mensaje CONSEJO

Crea un archivo llamado archivo.txt y lo pones en raiz y en el php.ini debes de editar el nombre del server de email:

A ESTE ARCHIVO NOMBRALO formulario.php Y VA EN RAIZ DE TU WEB SERVER

<?php
// José Arce ®2002
if(isset($_POST['enviar']))
{
$mail = "<font face=\"Verdana\" size=\"2\">";
$mail.= "<b>Empresa</b>: $_POST[empresa]<br>";
$mail.= "<b>Nombre</b>: $_POST[nombre]<br>";
$mail.= "<b>Cargo</b>: $_POST[cargo]<br>";
$mail.= "<b>Email</b>: $_POST[email]<br>";
$mail.= "<b>Telefono</b>: $_POST[telefono]<br>";
$mail.= "El siguiente comentario es acerca de <b>$_POST[comentario]</b><br><br>";
$mail.= "<b>Comentario:</b><br><i>$_POST[mensaje]</i><br>";
if (!$_POST['radio'])
{
$contacto = "no";
}
else
{
$contacto = "si";
}
$mail.= "El cliente $contacto requiere que se le contacte inmediatamente";
$mail.= "</font>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
if ($_POST['empresa'] && $_POST['nombre'] && $_POST['cargo'] && $_POST['email'] && $_POST['telefono'] && $_POST['comentario'] && $_POST['mensaje'] && $_POST['radio'])
{
$archivo = "Empresa: $_POST[empresa]\n";
$archivo.= "Nombre: $_POST[nombre]\n";
$archivo.= "Cargo: $_POST[cargo]\n";
$archivo.= "Email: $_POST[email]\n";
$archivo.= "Telefono: $_POST[telefono]\n";
$archivo.= "El siguiente comentario es acerca de $_POST[comentario]\n\n";
$archivo.= "Comentario:\n$_POST[mensaje]\n";
$archivo.= "El cliente $contacto requiere que se le contacte inmediatamente";
$archivo.= "-------------------------------------------------\n";
$txt = fopen("archivo.txt", "aw");
fputs($txt, $archivo);
fclose($txt);
if (mail("[email protected]", "PONER SUBJECT DEL MAIL", $mail, $headers))
{
print 'Gracias, los datos fueron enviados con éxito!';
}
}
else
{
echo "Por favor, llene todos los campos<br><br>Esto fué lo que usted escribió:<br>$mail";
}
}
?>
<html>
<head>
<title>Empresa</title>
<style>body
{
font-family: Verdana;
font-size: 10px;
color: FFFFFF;
}
input, textarea, select
{
color : #FFFFFF;
background-color: #006699;
font-family : Verdana, Helvetica, E58C00, Helvetica, sans-serif;
font-size : 10px;
border: 1px solid #FF9900;
}</style>
</head>
<body bgcolor="006699">
<form method="POST" action="<?php echo $PHP_SELF; ?>">
<table width="100%" border="0">
<tr>
<td width="17%" height="34"><font size="2">Empresa: </font></td>
<td width="83%"><font size="2">
<input name="empresa" type="text" id="empresa" size="29">
</font></td>
</tr>
<tr>
<td height="34"><font size="2">Nombre:</font></td>
<td><font size="2">
<input name="nombre" type="text" id="nombre" size="29">
</font></td>
</tr>
<tr>
<td height="34"><font size="2">Cargo:</font></td>
<td><font size="2">
<input name="cargo" type="text" id="cargo" size="29">
</font></td>
</tr>
<tr>
<td height="34"><font size="2">e-mail:</font></td>
<td><font size="2">
<input name="email" type="text" id="telefono" size="29">
</font></td>
</tr>
<tr>
<td height="34"><font size="2">Telefono:</font></td>
<td><font size="2">
<input type="text" name="telefono" size="29">
</font></td>
</tr>
<tr>
<td height="34"><font size="2">Comentario:</font></td>
<td><font size="2">
<select name="comentario" size="1" id="comentario">
<option value="website" selected>Sobre el Website</option>
<option value="ventas">Ventas</option>
<option value="soporte">Soporte</option>
<option value="quejas">Quejas</option>
</select>
</font></td>
</tr>
<tr>
<td height="34"><font size="2">&nbsp;</font></td>
<td><font size="2">
<textarea name="mensaje" cols="38" rows="5" id="mensaje"></textarea>
</font></td>
</tr>
<tr>
<td height="34" colspan="2"><font size="2">
<input name="radio" type="radio" value="si" checked>
Requiero se me contacte de inmediato</font></td>
</tr>
<tr>
<td height="34" colspan="2"><input type="submit" value="Enviar" name="enviar">
<input type="reset" value="Restablecer" name="borrar"></td>
</tr>
</table>
</form>
</body>
</html>


Saludos,
Cesar Castillo


_______________
Telematicos.net
http://www.telematicos.net
[email protected]
telematicos.net "La tecnología nunca duerme"