Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/02/2008, 04:42
Pastilla666
 
Fecha de Ingreso: septiembre-2005
Ubicación: Vejer de la Fra, Cádiz
Mensajes: 83
Antigüedad: 18 años, 8 meses
Puntos: 0
Enviar correos con adjuntos para moviles

Buenas, tengo un pequeño problemilla al enviar correos con datos adjuntos.

Mi problema es que los dispositivos moviles, como los blackberry (es con el que he probado) no recibe los adjuntos de los correos que se envian a traves del formulario creado con php:

Código PHP:
<?php     if (isset($_POST["Enviar"]))    {
            
$nom $_POST["nom"];
            
$ape $_POST["ape"];
            
$tel $_POST["tel"];
            
$ema $_POST["email"];
            
$pue $_POST["puesto"];
            
$com $_POST["comentario"];
            
            
//datos del arhivo subido
            
$arch_nom $HTTP_POST_FILES["curriculum"]['name'];
            
$arch_tmp $HTTP_POST_FILES["curriculum"]['tmp_name'];
            
$arch_tip $HTTP_POST_FILES["curriculum"]['type'];
            
$arch_tam $HTTP_POST_FILES["curriculum"]['size'];
            
            
$separador "_separador_de_trozos_".md5 (uniqid (rand()));
            
            
//Creo el asunto del mensaje
            
$asunto "Curriculum Online de ".$nom." ".$ape;
            
            
//Creo el cuerpo del mensaje
            
$cuerpo "    <html>
                        <head>
                            <title>Curriculum Vitae de "
.$nom." ".$ape."</title>
                        </head>
                        <body>
                            <table width='700' border='0' cellspacing='0' cellpadding='0' align='center'>
                                <tr><td height='35' valign='middle' align='center'>
                                        <div style='font-weight:bold; font-variant:small-caps;'>Curriculum enviado a trav&eacute;s de nuestra P&aacute;gina Web del Hotel</div>
                                    </td>
                                </tr>
                                <tr><td height='25'>
                                        <b>Nombre:</b> "
.$nom." ".$ape."
                                    </td>
                                </tr>
                                <tr><td height='25'>
                                        <b>Tel&eacute;fono:</b> "
.$tel."
                                    </td>
                                </tr>
                                <tr><td height='25'>
                                        <b>Correo Electr&oacute;nico:</b> "
.$ema."
                                    </td>
                                </tr>
                                <tr><td height='25'>
                                        <b>Puesto:</b> "
.$pue."
                                    </td>
                                </tr>
                                <tr><td height='25'>
                                        <b>Comentario:</b> "
.$com."
                                    </td>
                                </tr>
                            </table>
                            <br />
                            <hr size='2' width='800'>
                            <br />
                            <span style='font-size:16px; font-variant:small-caps;'>IP del Visitante:</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style='font-weight:bold;'>"
$HTTP_SERVER_VARS['REMOTE_ADDR']."</span><br>
                            <span style='font-size:16px; font-variant:small-caps;'>Puerto del Visitante:</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style='font-weight:bold;'>"
$HTTP_SERVER_VARS['REMOTE_PORT']."</span><br>
                        </body>
                        </html>"
;
            
            
// Parte primera -Mensaje en formato HTML 
            # Encabezado parcial
            
$mensaje ="--".$separador."\r\n";
            
$mensaje .="Content-Type: text/html; charset=\"ISO-8859-1\"\r\n"
            
$mensaje .="Content-Transfer-Encoding: 7bit\r\n\r\n"
            
# Contenido de esta parte del mensaje
            
$mensaje .= $cuerpo;

            
// Parte segunda -Fichero adjunto
            # Encabezado parcial
            
$arch "\r\n--".$separador."\r\n"
            
$arch .="Content-Type: image/jpeg; name=\"".$arch_tmp."\"\r\n";  
            
$arch .="Content-Disposition: inline; filename=\"".$arch_nom."\"\r\n";
            
$arch .="Content-Transfer-Encoding: base64\r\n\r\n";
            
            
# lectura  del fichero adjunto  
            
$fp fopen($arch_tmp"r"); 
            
$buff fread($fpfilesize($arch_tmp)); 
            
fclose($fp); 
            
            
# codificación del fichero adjunto  
            
$arch .=chunk_split(base64_encode($buff)); 
            
            
// Unión de las diferentes partes para crear
            
$arch .= "\r\n--".$separador."\r\n";
            
// el cuerpo del mensaje    
            
$cuerpo=$mensaje.$arch;

            
$cabeceras "MIME-Version: 1.0\r\n";
               
$cabeceras .= "Content-type: text/html; charset=iso-8859-1\r\n";
            
$cabeceras .= "From: ".$_POST["nom"]."<".$_POST["ema"].">\r\n";
            
$cabeceras .= "X-Mailer: PHP/".phpversion()."\r\n";
            
$cabeceras .= "Content-Type: multipart/mixed;\r\n"
            
$cabeceras .= " boundary=".$separador."\r\n";

            
//Cambio la configuracion SMTP del php.ini en tiempo de ejecucion
            //ini_set("SMTP", "mail.fairplaygolfhotel.com");
            
            //Mando el mail
            
if (mail("[email protected]"$asunto$cuerpo$cabeceras) == true)    {
                
//Aviso al usuario que el mail se ha enviado corectamente    ?>
                <table width="90%" cellpadding="0" cellspacing="0" border="0" align="center" style="margin-top:20px;">
                    <tr>
                        <td colspan="2" align="center" style="height:40px;"><span class="Estilo4" style="font-size:18px; font-weight:bold; font-variant:small-caps;">&iexcl;&iexcl; Gracias !! </span></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center" style="height:40px;"><span class="Estilo6">El mensaje se ha enviado correctamente. Gracias por su tiempo.</span></td>
                    </tr>
                </table>
                <div align="justify">
                  <?php        }
        }
He probado los emails en el outlook y van bien, llegan los adjuntos bien, pero no consigo hacerlos funcionar en los dispositivos moviles.

Muchas Gracias.