Foros del Web » Programando para Internet » PHP »

Codigo Htm Outlook

Estas en el tema de Codigo Htm Outlook en el foro de PHP en Foros del Web. hola, estoy enviando unos mail masivos , llegan bien a hotmail, gmail, etc pero en el cliente outlook el mensaje que se ve es el ...
  #1 (permalink)  
Antiguo 03/06/2009, 17:59
 
Fecha de Ingreso: abril-2005
Ubicación: colombia
Mensajes: 242
Antigüedad: 19 años
Puntos: 0
Codigo Htm Outlook

hola, estoy enviando unos mail masivos , llegan bien a hotmail, gmail, etc pero en el cliente outlook el mensaje que se ve es el codigo html , el codigo que utilizo es el siguiente,

$nombreRemitente =$array[from];
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ". $nombreRemitente."\r\n";
$headers .= "Reply-To:". $nombreRemitente."\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
echo $headers;
$html = "
<html>
<img src=\"$ruta\" />". $cad .
"</html>";
mail($array[email],$array[asunto],$html,$headers);

saben que puede ser???????????????????

gracias
__________________
:aplauso: Ivomat
  #2 (permalink)  
Antiguo 03/06/2009, 18:39
Avatar de abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 10 meses
Puntos: 1517
Respuesta: Codigo Htm Outlook

Verificate este demo, haz la prueba enviando un email a outlook y dejame saber como te va . Este ejemplo lo saque directamente de los comentarios de php.net. Es más bien por el concepto de boundary. Verifica sobre ese tema.

Código PHP:
<?PHP
$title
=$_POST['title'];
$name=$_POST['name'];
$email=$_POST['email'];
$telephone=$_POST['telephone'];
$fax=$_POST['fax'];
$address=$_POST['address'];
$country=$_POST['country'];
$comment=$_POST['comment'];

# -=-=-=- MIME BOUNDARY
$mime_boundary "----MSA Shipping----".md5(time());
# -=-=-=- MAIL HEADERS
$to "[email protected]";
//$to = "[email protected]";
//$to = "[email protected]";
$subject "Information Request from MSA Shipping - Contact Form";
$headers "From: MSA SHIPPING <[email protected]>\n";
$headers .= "Reply-To: MSA Shipping <[email protected]>\n";
$headers .= "BCC: [email protected]";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n";

$message .= "--$mime_boundary\n";
$message .= "Content-Type: text/html; charset=UTF-8\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";

$message .= "<html>\n";
$message .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#666666;\">\n";

$message .= "<table width=\"800\" height=\"159\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" >";
$message .="<tr>";
$message .="<td height=\"66\" colspan=\"4\" bgcolor=\"#CCCCCC\"></td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td width=\"1%\"></td>";
$message .="<td colspan=\"3\">&nbsp;</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Title</b></td>";
$message .="<td align=\"left\" >:</td>";
$message .="<td>$title</td>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td><b>Name</b></td>";
$message .="<td>:</td>";
$message .="<td>$name</td>";
$message .="</tr>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td><b>E-mail</b></td>";
$message .="<td>:</td>";
$message .="<td>$email</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td><b>Telephone</b></td>";
$message .="<td>:</td>";
$message .="<td>$telephone</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td><b>Fax</b></td>";
$message .="<td>:</td>";
$message .="<td>$fax</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td><b>Country</b></td>";
$message .="<td>:</td>";
$message .="<td>$country</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td><b>Comments</b></td>";
$message .="<td>:</td>";
$message .="<td>$comment</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td height=\"21\" colspan=\"4\" bgcolor=\"#CCCCCC\"></td>";
$message .="</tr>";
$message .="</table>";
$message .= "</body>\n";
$message .= "</html>\n";
# -=-=-=- FINAL BOUNDARY
$message .= "--$mime_boundary--\n\n";
# -=-=-=- SEND MAIL
$mail_sent = @mail$to$subject$message$headers );
//echo $mail_sent ? "Mail sent" : "Mail failed";
if($mail_sent)
{
header('Location:contactus.php?msg=yes');
}
else
{
header('Location:contactus.php?msg=no');
}
?>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:02.