Ver Mensaje Individual
  #6 (permalink)  
Antiguo 08/03/2006, 13:53
Avatar de GERMANCIN
GERMANCIN
 
Fecha de Ingreso: junio-2004
Mensajes: 151
Antigüedad: 19 años, 10 meses
Puntos: 0
Yo lo uso para enviar emails en HTML

Este codigo lo puedes sbir dierctamente a tu server y probralo , solo tienes que cambiar la direccion del email a donde llegará ...


<?
//************************************************** ******************************************
if ($txtAccion == ""){
$txtAccion="Boletin";
}
//************************************************** ******************************************
echo $txtAccion ."<br>";

?>

<? if ($txtAccion == "Enviar")
{
//add From: header
$headers = "From: Germanshito<[email protected]> \r\n";

//specify MIME version 1.0
$headers .= "MIME-Version: 1.0\r\n";

//unique boundary
$boundary = uniqid("HTMLDEMO");

//tell e-mail client this e-mail contains//alternate versions
$headers .= "Content-Type: multipart/mixed; boundary = $boundary\r\n\r\n";

$body .= "--$boundary\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$body .= chunk_split(base64_encode( $txtMensaje ));

//send message
mail("[email protected]","An HTML Message", $body, $headers);
}
?>




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>HTML MAIL</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<center>
<form action="" method="get" name="boletin">

<table width="750">

<tr>
<td>
<table width="100%" border="1" cellspacing="1">
<tr>
<td width="100%"> <div align="center">
<textarea name="txtMensaje" cols="50" rows="20"></textarea><br/>
<input name="ger" type="button" value="Enviar Boletín" onClick="boletin.txtAccion.value='Enviar';boletin. submit();">
</div></td>
</tr>
<tr>
<td><div align="center">
<input type="hidden" name="txtAccion">

</div></td>
</tr>
</table>
</td>
</tr>
</table>

</form>
</center>

</body>
</html>