Club Delphi  
    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

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 10-03-2017
aromigaret aromigaret is offline
Miembro
 
Registrado: jun 2011
Posts: 68
Poder: 13
aromigaret Va por buen camino
Insertar firma en mail con Indy

Hola, estoy intentando realizar una función que envíe mails y al final de dicho mail, estampe una firma la cual tiene un logo. Ya he probado de mil formas y lo que mejor sale es la firma en el cuerpo del mail, pero la firma va además como archivo adjunto y en el cuerpo el nombre del archivo que contiene dicha firma.
He aquí lo mas cercano que logre:

Código Delphi [-]
procedure TForm1.ENVIAR;
VAR
  I:INTEGER;
  html: TStrings;
  filename: string;

begin

  filename := ExtractFilePath(Application.ExeName) + 'Sello Mario Transparente.PNG';

  SMTP.Port := 25;
  SMTP.Host := HOST;
  SMTP.Username := USERNAME;
  SMTP.Password := CLAVE;

  try


    MAIL.Recipients.Add;
    MAIL.Recipients[0].Name := EMPRESA;
    MAIL.Recipients[0].Address := DESTINO;

    MAIL.Recipients.Add;
    MAIL.Recipients[1].Name := 'Copia de datos enviados al Contador';
    MAIL.Recipients[1].Address := COPIA;

    MAIL.From.Name := EMPRESA;
    MAIL.From.Address := DESTINO;


    mail.ContentType:='multipart/mixed';

    with TIdMessageBuilderHtml.Create do
    try
      Html.Text := 'Adjunto datos';
      HtmlFiles.Add(filename);
      Attachments.Add(filename);
      FillMessage(mail);
    finally
      Free;
    end;



    if ARCHIVOS.Items.Count >= 0  then
      for I:=0 TO ARCHIVOS.Items.Count - 1 do TIdAttachmentFile.Create(mail.MessageParts,ARCHIVOS.Items[i]);

    try

      SMTP.Connect;

      SMTP.Send(mail);

      if SMTP.Connected then
      BEGIN
        SMTP.Disconnect;
        SHOWMESSAGE('MAIL ENVIADO EXITOSAMENTE');
      end;

    except
      on E: Exception do SHOWMESSAGE(E.Message);
    end;

    MAIL.Clear;

  except
    on E: Exception do SHOWMESSAGE(E.Message);
  end;

end;



Agradecería si alguien sabe como resolver esto.
Saludos
Mario
Responder Con Cita
Respuesta


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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Adjunto noname en mail con Indy DrkMgc Internet 30 23-11-2023 22:16:35
Delphi - Mail Indy - tardanza shoulder Varios 3 06-05-2016 19:52:37
Error al enviar e-mail con Indy Iuconlas Internet 0 02-03-2011 19:56:57
Indy - Mail Display? jodycom Internet 2 05-04-2005 17:41:42
Problemas al descargar un Mail con los Indy Fizban Internet 8 09-09-2004 00:05:48


La franja horaria es GMT +2. Ahora son las 14:31:50.


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