Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/10/2005, 05:32
Avatar de yo12345
yo12345
 
Fecha de Ingreso: mayo-2005
Mensajes: 11
Antigüedad: 19 años
Puntos: 1
En la ayuda de php.net trae algo sobre esto , te pego lo que trae
Código PHP:
Problems with Microsoft Exchange and PHP as ISAPI-module

We found out, that if you want to send multipart mime emails using the PHP mail-function on a Windows box using a Microsoft Exchange server, you have to use separate containers for the mail body and the mail header.

In many examples like in http://www.zend.com/zend/trick/html-email.php or in the book PHP developers cookbook you find html multipart/alternative mailing solutions that build the mime header and the mail body into one PHP variable and send this as fourth argument (header) to the PHP mail-function. This works fine on most systems but not on the above mentioned combination.

We found a rather trivial solution: Simply split the mime mail header and the mail body into two separate variables and give them separately to the PHP mail function, example:

<?php
//add From: header
$headers "From: webserver@localhost\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";

//plain text version of message
$body "--$boundary\r\n" .
   
"Content-Type: text/plain; charset=ISO-8859-1\r\n" .
   
"Content-Transfer-Encoding: base64\r\n\r\n";
$body .= chunk_split(base64_encode("This is the plain text version!"));

//HTML version of message
$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("This the <b>HTML</b> version!"));

//send message
mail("root@localhost""An HTML Message"$body$headers);
?>
Mira la ayuda http:es.php.net