
28/08/2008, 09:24
|
 | | | Fecha de Ingreso: julio-2008 Ubicación: Lima Callao Chucuito
Mensajes: 1.931
Antigüedad: 16 años, 8 meses Puntos: 105 | |
Respuesta: Como puedo mandar un Formulario por mail Cita:
Iniciado por alvarock Hola a todos !!
Sigo con mi problemita de no saber como mandar un formulario por correo espero alguien me guie, sali de trasmiciones estos dias por enfermedad gracias Puedes probar con este codigo.... llamado despues de llenar todo el formulario con ekl evento action.... ojo, solo cambia las vairables recibidas y comentarios a tu gusto: Código PHP: <?php
$txt_nombre = $_REQUEST[txt_nombre];//nombre de la persona ;
$txt_fono = $_REQUEST[txt_fono] ; // telefono de la persona ;
$txt_mail = $_REQUEST[txt_mail] ; // email de la persona ;
$txt_numprof = $_REQUEST[txt_numprof]; // numero profesional que es la empresa ;
$txt_dir = $_REQUEST[txt_dir] ;// direccion del personal ;
$txt_local = $_REQUEST[txt_local]; // Localidad de la persona ;
$txt_codpos = $_REQUEST[txt_codpos] ; // Codigo Postal ;
$txt_prov = $_REQUEST[txt_prov] ;// provincia ;
$txt_desc = $_REQUEST[txt_desc] ; //comentarios ;
$EMailMensaje = "<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1 \" />
<title>FORMULARIO DEL CONTACTO</title>
</head>
<body>
<table width=\"547 \" height=\"241\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#F9F8F4\">
<tr>
<td height=\"25\" colspan=\"5\" align=\"center\" bgcolor=\"#E5E5E5 \" style=\"color: #0033CC; font-family:Arial, Helvetica, sans-serif; font-size:14px \">DATOS DEL CONTACTO</td>
</tr>
<tr>
<td height=\"27\" colspan=\"5\"> </td>
</tr>
<tr>
<td colspan=\"2\" > </td>
<td width=\"186\" height=\"25\" style=\"color:#990000; font-family:Arial, Helvetica, sans-serif; font-size:12px\" ><strong>Nombre (*) : </strong></td>
<td width=\"352\" colspan=\"2\" style=\"color: #333333; font-family:Arial, Helvetica, sans-serif; font-size:12px\"><label>$txt_nombre</label></td>
</tr>
<tr>
<td colspan=\"2\" > </td>
<td height=\"25\" style=\"color:#990000; font-family:Arial, Helvetica, sans-serif; font-size:12px\"><strong>Teléfono (*):</strong> </td>
<td colspan=\"2\" style=\"color: #333333; font-family:Arial, Helvetica, sans-serif; font-size:12px\">$txt_fono</td>
</tr>
<tr>
<td colspan=\"2\" > </td>
<td height=\"25\" style=\"color:#990000; font-family:Arial, Helvetica, sans-serif; font-size:12px\"><strong>Correo electrónico (*) :</strong> </td>
<td colspan=\"2\" style=\"color: #333333; font-family:Arial, Helvetica, sans-serif; font-size:12px\">$txt_mail</td>
</tr>
<tr>
<td colspan=\"2\" > </td>
<td height=\"25\" style=\"color:#990000; font-family:Arial, Helvetica, sans-serif; font-size:12px\"><strong>Empresa:</strong> </td>
<td colspan=\"2\" style=\"color: #333333; font-family:Arial, Helvetica, sans-serif; font-size:12px\">$txt_numprof</td>
</tr>
<tr>
<td colspan=\"2\" > </td>
<td height=\"25\" style=\"color:#990000; font-family:Arial, Helvetica, sans-serif; font-size:12px\"><strong>Dirección:</strong> </td>
<td colspan=\"2\" style=\"color: #333333; font-family:Arial, Helvetica, sans-serif; font-size:12px\">$txt_dir</td>
</tr>
<tr>
<td colspan=\"2\" > </td>
<td height=\"25\" style=\"color:#990000; font-family:Arial, Helvetica, sans-serif; font-size:12px\"><strong>Localidad:</strong> </td>
<td colspan=\"2\" style=\"color: #333333; font-family:Arial, Helvetica, sans-serif; font-size:12px\">$txt_local</td>
</tr>
<tr>
<td colspan=\"2\" > </td>
<td height=\"25\" style=\"color:#990000; font-family:Arial, Helvetica, sans-serif; font-size:12px\"><strong>Código postal:</strong> </td>
<td colspan=\"2\" style=\"color: #333333; font-family:Arial, Helvetica, sans-serif; font-size:12px\">$txt_codpos</td>
</tr>
<tr>
<td colspan=\"2\" > </td>
<td height=\"25\" style=\"color:#990000; font-family:Arial, Helvetica, sans-serif; font-size:12px\"><strong>Provincia :</strong> </td>
<td colspan=\"2\" style=\"color: #333333; font-family:Arial, Helvetica, sans-serif; font-size:12px\">$txt_prov</td>
</tr>
<tr>
<td colspan=\"2\" valign=\"top\" > </td>
<td height=\"25\" valign=\"top\" style=\"color:#990000; font-family:Arial, Helvetica, sans-serif; font-size:12px\" ><strong>Comentarios :</strong> </td>
<td colspan=\"2\" style=\"color: #333333; font-family:Arial, Helvetica, sans-serif; font-size:12px\"><label>".htmlentities($txt_desc)."</label></td>
</tr>
</table>
</body>
</html>";
$subject = "Formulario de Contacto";
$headers="MIME-Version: 1.0\r\n";
$headers.="Content-type: text/html; charset=iso-8859-1\r\n";
$headers.="From: {$txt_nombre}<{$txt_email}>\r\n";
mail("[email protected]",$subject,$EMailMensaje,$headers);
echo "<script>alert('Sus datos han sido enviados satisfactoriamente, nos pondremos en contacto con Ud. en breve.');</script>";
echo "<script> document.location='index.php'; </script>";
?> Espero te sirva.......
Atte. MasterOjitos |