Foros del Web » Programando para Internet » PHP »

Problema con funcion mail

Estas en el tema de Problema con funcion mail en el foro de PHP en Foros del Web. wenas tengo una pagina para enviar emails, con la funcion mail() y funciona bien, pero si intento enviar un email a un servidor de correo ...
  #1 (permalink)  
Antiguo 10/10/2005, 03:39
 
Fecha de Ingreso: mayo-2004
Ubicación: Barcelona
Mensajes: 200
Antigüedad: 19 años, 11 meses
Puntos: 0
Exclamación Problema con funcion mail

wenas

tengo una pagina para enviar emails, con la funcion mail() y funciona bien,
pero si intento enviar un email a un servidor de correo Microsoft Exchange de un amigo.. no le llegan los mensajes, es super raro porq no da ningun error al enviar ni nada, simplemente no llegan... y vamos por ejemplo a Yahoo y enviamos un email a la misma direccion y si q llega..
entonces me supongo q sera un problema con la funcion mail()
necesito ayuda porfavor, gracias

Salud2

Última edición por fido85; 10/10/2005 a las 04:15
  #2 (permalink)  
Antiguo 10/10/2005, 05:32
Avatar de yo12345  
Fecha de Ingreso: mayo-2005
Mensajes: 11
Antigüedad: 18 años, 11 meses
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
  #3 (permalink)  
Antiguo 10/10/2005, 10:50
 
Fecha de Ingreso: octubre-2005
Mensajes: 1
Antigüedad: 18 años, 6 meses
Puntos: 0
muy bien, a mi tambien me paso




www.p2p.turincon.com configuracion Emule y speederxp
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 08:53.