Ver Mensaje Individual
  #5 (permalink)  
Antiguo 26/11/2014, 04:04
Avatar de fbedia
fbedia
 
Fecha de Ingreso: julio-2010
Mensajes: 159
Antigüedad: 13 años, 10 meses
Puntos: 8
Respuesta: Problema con tildes en formulario (no es el típico, creo...)

Sobre tu duda la verdad que no se que puede ser... Todo parece estar OK.
Yo uso la clase PHPMailer en vez de la tipica mail()

Simplemente tienes que descargartela de internet e incluirla en tu proyecto.

Después, puedes usar esta funcion PHP que me he creado yo, adaptandola a tu proposito:

Código PHP:
Ver original
  1. <?php
  2. function enviar_mail($Subject, $address, $cuerpo) {
  3.    
  4.     /*
  5.      $Subject = asunto del mail
  6.      $address = correo del destinatario
  7.      $cuerpo = texto del correo
  8.      */
  9.    
  10.     require_once('PHPMailer/class.phpmailer.php');
  11.     //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
  12.  
  13.     $mail             = new PHPMailer();
  14.     $mail->IsSMTP(); // telling the class to use SMTP
  15.     $mail->Host       = "smtp.1and1.es"; // SMTP server
  16.     //    $mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
  17.                                             // 1 = errors and messages
  18.                                             // 2 = messages only
  19.     $mail->SMTPAuth   = true;                  // enable SMTP authentication
  20.     $mail->Host       = "smtp.1and1.es"; // sets the SMTP server
  21.     $mail->Port       = 587;                    // set the SMTP port for the GMAIL server
  22.     $mail->Username   = "[email protected]"; // SMTP account username
  23.     $mail->Password   = "xxxxxxxxx";        // SMTP account password
  24.     $mail->SetFrom("[email protected]","Intranet");
  25.     $mail->AddReplyTo("[email protected]","Intranet");
  26.    
  27.     $mail->Subject    = $Subject;
  28.  
  29.  
  30.     $mail->MsgHTML("<html>
  31.            <body>
  32.                <STYLE type='text/css'>
  33.                    
  34.                    body{
  35.                        font-family: Arial, Helvetica, sans-serif;
  36.                        font-size: 12px;
  37.                        color: #415178;
  38.                        font-weight: normal;
  39.                    }
  40.                    a:link, a:visited {
  41.                      
  42.                        color: #b38ebe;
  43.                        text-decoration: none;
  44.                    }
  45.                    a:hover {
  46.                        color: #8f5f9d;
  47.                        font-weight: normal;
  48.                        text-decoration: underline;
  49.                    }
  50.                  
  51.                </STYLE>
  52.                <table bgcolorborder='0' cellspacing='0' cellpadding='0' width='600' align='center'>
  53.                    <tr>
  54.                        <td>
  55.                            <p><a href='http://xxx' title='Intranet'><img src='imagenes/logos.png' title='Intranet' alt='Intranet'/></a></p>
  56.                        </td>
  57.                    </tr>
  58.                    <tr>
  59.                        <td>
  60.                        <table border='0' cellspacing='0' cellpadding='0' width='580' align='center'>
  61.                                <p><br></p>
  62.                                <p style='font-family:Arial, Helvetica, sans-serif; font-size:26px; color:#ff9900;'>>> Intranet</p>
  63.                                <p>$cuerpo</p>
  64.                                <p><b><i>Recuerde tratar el contenido de este correo con privacidad.</i></b></p>
  65.                        </table>
  66.                        </td>
  67.                    </tr>
  68.                </table>
  69.            </body>  
  70.        </html>
  71.    ");
  72.  
  73.     $mail->AddAddress($address, $address);
  74.    
  75.     $mail->Send();
  76.  
  77. }
  78. ?>

Aunque lo anterior no de respuesta a tu problema... como alternativa, espero que te sirva.

Saludos.

**EDITO:

La clase puedes descargarla de aqui: https://github.com/PHPMailer/PHPMailer
La funcion la puedes probar asi: enviar_mail("prueba", "[email protected]", "asdfasddas");
__________________
Follow me on twitter @franbedia

Última edición por fbedia; 26/11/2014 a las 04:06 Razón: Agregar info