Re: [PHP-ES] Clase de envío de correos

[email protected] (Manuel Lozano)
Newsgroups php.general.es
Message-ID <[email protected]>
http://sourceforge.net/projects/phpmailer/

No sé hasta que punto será funcional tu código, yo he utilizado phpmailer,
me resulto
la forma más cómoda para componer mis correos y especificar puertos de
salida y demás.

Un Saludo.

El 28 de mayo de 2010 14:59, Gorka <[email protected]> escribió:

>
>
> > -----Mensaje original-----
> > De: Gorka [mailto:[email protected]]
> > Enviado el: miércoles, 26 de mayo de 2010 10:26
> > Para: 'PHP CA'
> > Asunto: [PHP-ES] Clase de envío de correos
> >
> >
> > Trato de usar la clase del php para envio de correo, ya que crea
> > correctamente los headers del evitando que el correo mal formado sea
> > clasificado como SPAM. Todo era muy bonito al principio, ... pero
> > resulta
> > que en el cuerpo del email me sale el código HTML tal que así:
> >
> >       <font face='Arial' color='#365375'><br>Estimado (...)
> >
> > ¿Cómo puedo evitarlo?
> >
> >
> >
> > La llamada a la función es la siguiente:
> >
> >     enviar_correo($emailm , $asunto, $cuerpomensaje,
> > '[email protected]');
> >
> > Y la función y la clase de php son:
> >
> >     class correo
> >     {
> >       var $destinatario;
> >       var $remitente;
> >       var $asunto;
> >       var $mensaje;
> >
> >         function enviar()
> >         {
> >               $headers = "From: ".$this->remitente."\nReply-To: ".
> > $this->remitente;
> >               ob_start();
> >               $message = ob_get_clean();
> >               $mail_sent = @mail( $this->destinatario, $this->asunto,
> > $this->mensaje, $headers );
> >               echo $destinatario;
> >               echo $mail_sent ? "Correo Enviado" : "No se ha podido
> > enviar
> > el correo";
> >       }
> >     }
> >
> >
> >     function enviar_correo($to, $subject, $message, $from)
> >     {
> >         $email_txt = $message; // Message that the email has in it
> >         $encoded_subject =
> > "=?$charset?B?".base64_encode($subject)."?=\n";
> >
> >         $headers = "From: ".$from;
> >         $msg_txt=" ";
> >         $semi_rand = md5(time());
> >         $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
> >         $headers .= "\nMIME-Version: 1.0\n" .
> >         "Content-Type: multipart/mixed;\n" .
> >         " boundary=\"{$mime_boundary}\"";
> >         $email_txt .= $msg_txt;
> >         $email_message .= "This is a multi-part message in MIME
> > format.\n\n"
> > .
> >         "--{$mime_boundary}\n" .
> >         "Content-Type:text/html; charset=\"iso-8859-1\"\n" .
> >         "Content-Transfer-Encoding: 7bit\n\n" .
> >         $email_txt . "\n\n";
> >
> >         //$ok = @mail($email_to, $email_subject, $email_message,
> > $headers,
> > '-f'.$from);
> >
> >         $g = new correo();
> >         $g->destinatario = $to;
> >         $g->remitente = $from;
> >         $g->asunto = $encoded_subject;
> >         $g->mensaje = $email_txt;
> >         $g->enviar();
> >     }
> >
> >
>
> ¿Ninguna idea?
>
>
>
>
> --
> PHP Spanish Localization Talk Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.