Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 15-02-2010
serpiente serpiente is offline
Miembro
 
Registrado: jun 2006
Posts: 12
Poder: 0
serpiente Va por buen camino
Enviar adjunto HTML

Si yo envío un adjunto con thunderbir, outlook, gmail etc... en html cuando llega a su destino muestra directamente el contenido, no lo muestra como adjunto, sin embargo cuando lo mando desde el delphi con los componentes indy no me lo muestra, sino que muestra el fichero como adjunto.

Yo quiero que cuando lo mando desde delphi me lo muestre directamente.

Gracias
Responder Con Cita
  #2  
Antiguo 15-02-2010
jceluce jceluce is offline
Miembro
 
Registrado: may 2003
Ubicación: Mar del Plata - Argentina
Posts: 29
Poder: 0
jceluce Va por buen camino
Hola, mirá este link. Seguro que te resuelve el tema.
Saludos
http://www.projectindy.org/sockets/B...8_17_A.en.aspx
__________________
Saludos

Javier
Responder Con Cita
  #3  
Antiguo 15-02-2010
serpiente serpiente is offline
Miembro
 
Registrado: jun 2006
Posts: 12
Poder: 0
serpiente Va por buen camino
Creo que en esta página está lo que busco, pero tengo un problema, entre que está en inglés y que no entiendo mucho lo que dice. Donde tengo que añadir las lineas correspondientes a indy 10 que es la versión que tengo, no se si alguien me podria explicar a grosso modo que hay que hacer.

Gracias.
Responder Con Cita
  #4  
Antiguo 16-02-2010
jceluce jceluce is offline
Miembro
 
Registrado: may 2003
Ubicación: Mar del Plata - Argentina
Posts: 29
Poder: 0
jceluce Va por buen camino
Hola, te paso la formar en que yo lo hice a ver si te ayuda (no sé si cambia algun nombre o propiedad de los componentes ya que yo lo hice con las Indy8):

Saludos


Código Delphi [-]
      
     with idMessage1 do begin
        // Cuerpo del mensaje.
        Body.Clear;
        MessageParts.Clear;
        ContentType := 'text/html';


        with TIdText.Create(IdMessage1.MessageParts, nil) do begin
          Body.LoadFromFile(edFileName.Text);  // El archivo con el html
          ContentType := 'text/html';
        end;

        // Cuenta Origen.
        From.Address := FieldByName('CE_DIRECCION').AsString;
        From.Name := FieldByName('CE_NOMBRE').AsString;
        // direccion de respuesta
        ReplyTo.EMailAddresses := FieldByName('CE_RESPUESTA').AsString;
        // Asunto del email.
        Subject := edAsunto.Text;
        // Prioridad del mensaje, ALTA.
        Priority := TidMessagePriority(mpHighest);
      end;


      with idSMTP1 do begin
        // Configuro autentificación.
        AuthenticationType := atLogin;
        UserId := FieldByName('CE_SMTP_USERID').AsString;  // Nombre del usuario
        Password := FieldByName('CE_SMTP_PASSWORD').AsString;  // la password
        // Configuro el servidor SMTP.
        Host := FieldByName('CE_SMTP').AsString;
        Port := 25;

        try
          Connect;
          try
            // Envio el mensaje.
            Estado := 'Enviando emails...';

            With DM, QResult do begin
              FetchAll;

              pbProgreso.Max := RecordCount;

              if chkDestinatarios.Checked then
                MaxDestinatarios := Trunc(edMaxDest.Value)
              else
                MaxDestinatarios := RecordCount;


              // Cuenta Destino.

              idMessage1.Recipients.EMailAddresses := idMessage1.ReplyTo.EMailAddresses;

              idMessage1.BccList.Clear;
              First;
              While not EOF do begin

                pbProgreso.Position := RecNo;
                pbProgreso.Refresh;

                if ValidaEmail(FieldByName('email').AsString) then
                  With idMessage1, BCCList do begin
                    Add.Address := Trim(FieldByName('email').AsString);
                    if Count = MaxDestinatarios then begin
                      //Send(idMessage1);
                      EnviaEmail;
                      BCCList.Clear;
                    end;
                  end;

                Next;
              end;

              With idMessage1, BccList do
                if Count > 0 then EnviaEmail; //Send(idMessage1);

            end;

            Estado := 'Desconectando...';

          finally
            Disconnect;
            Screen.Cursor := crDefault;
          end;
          //ShowMessage('El Pedido fue enviado correctamente !!!');
        except
           // Capturo algunas excepciones que pueden ocurrir
          ON E: EIdProtocolReplyError do begin
            ShowMessage('No se ha podido enviar el email.' + #13 +
                'Incorrecto el email o el usuario o la password.' + #13 +
                E.Message + #13 + idMessage1.BccList.EMailAddresses);
          end;
          on E: EFOpenError do begin
            ShowMessage('No se ha podido enviar el email.' + #13 +
                'Fichero Adjunto desconocido o erróneo.');
          end;
          on E: EIdSocketError do begin
            ShowMessage('No se ha podido enviar el email.'+ #13 +
                'Host desconocido o incorrecto.');
          end
          else begin
            ShowMessage('Fallo en el envio de email');
          end;
        end;
        if connected then Disconnect;

      end;
__________________
Saludos

Javier
Responder Con Cita
  #5  
Antiguo 16-02-2010
serpiente serpiente is offline
Miembro
 
Registrado: jun 2006
Posts: 12
Poder: 0
serpiente Va por buen camino
Muchas gracias, parece que va todo bien
Responder Con Cita
Respuesta



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Enviar mensaje (con fichero adjunto) a gmail Jose Manuel Ten Internet 2 31-07-2007 23:43:09
Enviar un email con un archivo adjunto Turboleta Internet 9 31-07-2006 19:55:16
Enviar adjunto por mail joel20 JAVA 3 10-07-2006 13:09:38
Enviar email con copia y adjunto con indy cmena Internet 4 01-10-2005 01:14:00
Enviar correo con dato adjunto jncrls Internet 1 06-05-2003 15:26:33


La franja horaria es GMT +2. Ahora son las 01:08:09.


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