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 19-10-2007
itsi itsi is offline
Miembro
 
Registrado: oct 2006
Posts: 29
Poder: 0
itsi Va por buen camino
Enviar email usando OUTLOOK 2003 - 2ª Parte

Buenos días a tod@s.

Despues de leer el hilo de (Enviar email usando OUTLOOK 2003), me funciona, pero tengo unas cuantas preguntas...... Os explico previamente lo que intento hacer.....

Genero un Informe con una ó varias empresas... (supongamos 5 empresas). Cuando envio los email mediante el OUTLOOK 2003.....

1 - solo reciben los ficheros adjuntos los que tengan OUTLOOK 2003.

2 - cuando termina de generar el archivo PDF y lo envio. El OUTLOOK 2003 me sale la siguiente pantalla.

3 - ¿Sabe alguien como que lo puedo hacer directamanete....?

4 - ¿Como puedo enviar para que lo puedan recibir todos?, dependiendo del Correo electronico que tengo el cliente.

Código Delphi [-]
procedure TForm.SpeedButton9Click(Sender: TObject);
var
Asunto,Texto,FicheroAEnviar, Direccion : string

begin
  Asunto := 'Hola';
  Texto := 'Adjunto le remito....';
  FicheroAEnviar := 'c:\pdf1.pdf'; //Aqui cambia el nombre del archivo
  Direccion := 'ppp@ppp.com'
        
  SendMailMAPI(Asunto,Texto,FicheroAEnviar,'','',Direccion,Direccion);

end;

function TForm.SendMailMAPI(const Subject, Body, FileName, SenderName,
  SenderEMail, RecepientName, RecepientEMail: String): Integer;
var
  message: TMapiMessage;
  lpSender, lpRecepient: TMapiRecipDesc;
  FileAttach: TMapiFileDesc;
  SM: TFNMapiSendMail;
  MAPIModule: HModule;
begin

  FillChar(message, SizeOf(message), 0);

  with message do begin
    if (Subject<>'') then
      lpszSubject := PChar(Subject);
    if (Body<>'') then
      lpszNoteText := PChar(Body);
    if (SenderEMail<>'') then begin
      lpSender.ulRecipClass := MAPI_ORIG;
      if (SenderName='') then
        lpSender.lpszName := PChar(SenderEMail)
      else
        lpSender.lpszName := PChar(SenderName);
      lpSender.lpszAddress := PChar('SMTP:'+SenderEMail);
      lpSender.ulReserved := 0;
      lpSender.ulEIDSize := 0;
      lpSender.lpEntryID := nil;
      lpOriginator := @lpSender;
    end;
    if (RecepientEMail<>'') then begin
      lpRecepient.ulRecipClass := MAPI_TO;
      if (RecepientName='') then
        lpRecepient.lpszName := PChar(RecepientEMail)
      else
        lpRecepient.lpszName := PChar(RecepientName);
      lpRecepient.lpszAddress := PChar('SMTP:'+RecepientEMail);
      lpRecepient.ulReserved := 0;
      lpRecepient.ulEIDSize := 0;
      lpRecepient.lpEntryID := nil;
      nRecipCount := 1;
      lpRecips := @lpRecepient;
      end
    else
      lpRecips := nil;
    if (FileName='') then begin
      nFileCount := 0;
      lpFiles := nil;
      end
    else begin
      FillChar(FileAttach, SizeOf(FileAttach), 0);
      FileAttach.nPosition := Cardinal($FFFFFFFF);
      FileAttach.lpszPathName := PChar(FileName);
      nFileCount := 1;
      lpFiles := @FileAttach;
    end;
  end;

  MAPIModule := LoadLibrary(PChar(MAPIDLL));
  if MAPIModule = 0 then begin
    Result := -1;
  end
  else begin
    try
      @SM := GetProcAddress(MAPIModule, 'MAPISendMail');
      if @SM <> nil then
        Result := SM(0,  0, message, MAPI_LOGON_UI , 0)
      else
        Result := 1;
    finally
      FreeLibrary(MAPIModule);
    end;
  end;

  if Result <> 0 then
    showmessage('Error al enviar el Correo ('+IntToStr(Result)+').')
end;

Gracias de antemano.
Archivos Adjuntos
Tipo de Archivo: zip Outlook2003.zip (14,9 KB, 22 visitas)
Responder Con Cita
  #2  
Antiguo 20-10-2007
Avatar de Chris
[Chris] Chris is offline
Miembro Premium
 
Registrado: abr 2007
Ubicación: Jinotepe, Nicaragua
Posts: 1.678
Poder: 19
Chris Va por buen camino
En este hilo habíamos hablado del mismo tema. pasé semanas, buscando la solución, al final di con esta.
__________________
Perfil Github - @chrramirez - Delphi Blog - Blog Web
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
Enviar email usando OUTLOOK 2003 Jose Manuel Internet 48 10-08-2012 05:41:56
Evitar confirmacion de envio de email en outlook 2003 Durbed Internet 0 05-10-2007 14:16:44
Enviar email con outlook express fedelphi Varios 2 29-01-2007 18:13:01
Enviar mail usando SMTP pero no OUTLOOK brandolin Internet 2 31-01-2006 03:32:30
Enviar email a través de Outlook Express kambiz Internet 9 20-10-2004 22:58:12


La franja horaria es GMT +2. Ahora son las 04:18:07.


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