<html>
<head>
<title>Contacto</title>
</head>
<body>
<?php
$nombre = stripslashes($_POST["nombre"]);
$correo = $_POST["correo"];
$sexo = $_POST["sexo"];
$pais = $_POST["pais"];
$temas = explode(',',$_POST["temas"]);
$comentarios = $_POST["comentarios"];
$formatos = array("text/html", "text/plain");
$remitente = "
[email protected]";
$para = "
[email protected]";
$asunto = "Contacto";
$formato_correo = 0;
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-type: " . $formatos[$formato_correo] . "; charset=iso-8859-1\r\n";
$header .= "From: " . $remitente . "\n";
if($nombre != "" && $correo != "") { //
if($formato_correo == 0) { /* HTML */
$mensaje = '
<style type="text/css">
<!--
.Estilo1 {
font-family: Arial;
font-size: 14px;
}
.Tabla_Contacto td {
padding:5px 5px 10px 5px;
}
.Estilo2 {
color: #990000;
font-weight: bold;
}
hr {
color:#003366;
background-color:#003366;
height:5px;
width:450px;
margin-left:0px;
}
-->
</style>
<span class="Estilo1"><span class="Estilo2">' . $asunto . '</span></span><br />
<br />
<hr />
<table width="438" border="0" cellspacing="0" cellpadding="0" class="Tabla_Contacto">
<tr>
<td width="111" class="Estilo1"><strong>Nombre:</strong></td>
<td width="327" class="Estilo1">' . $nombre . '</td>
</tr>
<tr>
<td class="Estilo1"><strong>Email:</strong></td>
<td class="Estilo1">' . $correo . '</td>
</tr>
<tr>
<td class="Estilo1"><strong>Sexo:</strong></td>
<td class="Estilo1">' . $sexo . '</td>
</tr>
<tr>
<td class="Estilo1"><strong>País:</strong></td>
<td class="Estilo1">' . $pais . '</td>
</tr>
<tr>
<td class="Estilo1"><strong>Temas:</strong></td>
<td class="Estilo1"> </td>
</tr>
<tr>
<td class="Estilo1"> </td>
<td class="Estilo1">';
for($i = 0; $i < count($temas); $i++) {
$mensaje .= $temas[$i] . "<br>";
} $mensaje .= '</td>
</tr>
<tr>
<td class="Estilo1"><strong>Comentarios:</strong></td>
<td class="Estilo1"> </td>
</tr>
<tr>
<td colspan="2" class="Estilo1">' . nl2br(stripslashes($comentarios)) . '</td>
</tr>
</table>
<hr />
<hr style="height:10px" />';
}
else { /* Texto Plano */
$mensaje = "
----------------------------------------------------------------------------\n
Nombre: " . $nombre . "\n
Email: " . $correo . "\n
Sexo: " . $sexo . "\n
País: " . $pais . "\n
Temas: ";
for($i = 0; $i < count($temas); $i++) {
$mensaje .= $temas[$i] . "\n";
} $mensaje .= "
Comentarios: " . $comentarios . "\n
----------------------------------------------------------------------------\n
";
}
}
if($mensaje != "")
{
if(mail($para, $asunto, $mensaje, $header))
echo '&resultado=S&';
else
echo '&resultado=N&';
}
else
echo '&resultado=N&';
?>
</body>
</html>
Esto lo saque de un tutorial.... es lo mas parecido a lo que yo quiero desarrollar,
aunque en mi formulario sobraria con los 4 checkbox o los cuatro radiobuttons...
pero como sois unos maquinas os lo currais mucho mas que yo... y me intento adaptar...