Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Colaboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 07-03-2005
Avatar de JuanBCT
JuanBCT JuanBCT is offline
Miembro
 
Registrado: ago 2004
Ubicación: Campana, Argentina
Posts: 57
Poder: 22
JuanBCT Va por buen camino
Lo logré!!

Finalmente logré enviar el mensaje; explico acá lo que hice por si le sirva a alguien...

1) Guardo el contenido del cuerpo en un archivo RTF temporal
Código Delphi [-]
 Datamodule1.MailsCuerpo_Mail.SaveToFile('C:\WINDOWS\EMKTMP.RTF');

2) Convierto el RTF en HTML (lo hice con una rutina freeware q encontré en Torry.net)

3) Leo el HTML y lo cargo en un RichEdit invisible:
Código Delphi [-]
 try
 Archiv.LoadFromFile('C:\WINDOWS\EMKTMP.HTM');
  for A:=0 to Archiv.Count -1 do
   begin
     SS:=archiv.Strings[A];
     richedit1.Lines.Add(SS);
   end;
 finally
    Archiv.Free;
 end;

4) Mando el mail, y en el Body le asigno el texto del RichEdit invisible:
Código Delphi [-]
 //Seteando propiedades del SMTP
 IdSMTP1.Host:=DbEdit6.Text;
 IdSMTP1.Port:=25;
 //Seteando propiedades del mensaje
 IdMessage1.From.Address:=DbEdit7.Text;
 IdMessage1.Subject:=DbEdit5.Text;
 IdMessage1.Body.Text:=RichEdit1.Text;
 //Envío el mensaje
 try
   try
     IdSMTP1.Connect(1000);
     IdSMTP1.Send(IdMessage1);
     except on E:Exception do
       ShowMessage ('Error. Chequee las direcciones en "Configuración de cuenta".');
     end;
   finally
     if IdSMTP1.Connected then IdSMTP1.Disconnect;
     ShowMessage ('Mensaje enviado.');
   end;

Listo!
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 19:17:31.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi