Ver Mensaje Individual
  #17 (permalink)  
Antiguo 14/12/2004, 22:29
nostromo_
 
Fecha de Ingreso: diciembre-2004
Ubicación: Iquique, Chile
Mensajes: 150
Antigüedad: 19 años, 4 meses
Puntos: 0
Hola;

En cuanto a la pregunta como enviar en formato html los email, aquí tengo lo siguiente :

form de envio

Código HTML:
<html>
<head><title>Formulario de Prueba</title>
</head>
<link href=estilo.css type=text/css rel=stylesheet>
<body>
<form name=emilio method=post action=email_1.php target=res>
	<table width="400" class=txt>
		<tr>
			<td align=left>
				Nombre:
				<br>
				<input type="text" name="name" size="20" maxlength="30">
				<br>
				Email para:
				<br>
				<input type="text" name="email1" size="20" maxlength="30">
				<p>Su Email:
				<br>
				<input type="text" maxlength="40" width="20" name="email2">
				<br>
				Título:
				<br>
				<input type="text" name="subject" size="20" maxlength="30">
				<br>
				Mensaje:
				<br>
				<textarea rows="11" cols="40" name="message"></textarea>
				<p>
				<input type="submit" value="Enviar">
				<br>
			</td>
		</tr>
	</table>
</form>
Resultado :<br>
<table border=0 cellspacing=0 cellpadding=0 width=250 class=bor>
	<tr>
		<td>
			<iframe name=res width=100% height=120 frameborder=0></iframe>
		</td>
	</tr>
</table>

</body>
</html> 
El código php del email :

Código PHP:
<?php
// -- Variables ------

$nombre $_POST['name'];
$email_to $_POST['email1'];
$email_my $_POST['email2'];
$titulo $_POST['subject'];
//$mensaje = $_POST['message'];
//$part2 .= "<ul>\n<li>AP-1 MX\n<li>TP\n<li>HS-1\n</ul>\n<center>\n";
//-- cuerpo html
$css "<style>\nbody {font-family:verdana;font-size:12px;cursor:hand;}\n.txt {font-weight:bold;color:blue;}\n";
$css .=".txt1 {font-size:12px;}\n.txt2 {font-size:14px;color:red;font-weight:bold;}\n</style>";
$html_i "<html><head>\n<title>Ofertas </title>\n".$css."</head>\n<body>\n<center>\n";
$part1 "<span style='font-size:18px;color:blue;font-weight:bold;'>Computer and Sensor Srl</span><br>\n";
$part1 .= "<h2>OFERTAS</h2>\n";
$part2 "<span  style='font-size:13px;text-align:center;color:white;font-weight:bold;background-color:blue;border:solid 1px #000000;width:170px;'>";
$part2 .= "Balanza Comercial</span><br>\n";
$part3 "<table border=0 cellspacing=0 cellpadding=0 class=txt1 width=260>\n";
$part3 .= "<tr><td colspan=2 align=center style='font-size:14px;font-weight:bold;'>SERIES AP</td></tr>\n";
$part3 .= "<tr><td colspan=2 style='font-weight:bold;color:blue;' align=center>MODELO</td></tr>\n";
$part3 .= "<tr>\n<td><img src=as.gif'></td>\n";
$part3 .= "<td style='border:solid 1px #000000;'>\n<ul>\n<li>Capacidad (30 kg.)\n<li>Peso Producto (7.2 kg.)\n</ul>\n</td></tr>\n";
$part3 .= "<tr><td colspan=2 align=left style='font-size:14px;color:red;font-weight:bold;'>OFERTA U$ 100.00.-<br>";
$part3 .= "Cantidad Mínima Pedido = 12 UN.</td></tr>\n</table>\n";
$part4 "</center>\n<br><br>\nSitio Web : <a href='http://www.dd.com' target='_blank'>DD</a><br>\n";
$part4 .= "Ofertas : <a href='http://www.D.com/ofertas.php' target='_blank'>Ofertas!!</a><br>\n";
$part4 .= "Contacto : [email][email protected][/email]\n";
$html_f "</body>\n</html>";
$headers "MIME-Version: 1.0\r \n"
$headers .= "Content-type: text/html; charset=iso-8859-1\r \n"
$headers .= "From: \"$nombre\" <$email_my>\r \n"//$headers .= "Reply-To: \"$nombre\" <$emailwebmaster>\r \n"; 
$headers .= "X-Priority: 5\r \n"
$headers .= "X-MSMail-Priority: High\r \n"
$headers .= "X-Mailer: Just My Server";
//--------------------
PRINT "<CENTER>";
PRINT 
"Hola, $nombre.";
PRINT 
"<BR><BR>";
PRINT 
"Gracias por utilizar EmailD $email_to";
PRINT 
"</CENTER>";
#
$menhtml $html_i.$part1.$part2.$part3.$part4.$html_f;
#
mail("$email_to","$titulo",
"$menhtml",
"$headers");
#
print $nombre;

?>
Nos vemos.