Puedes utilizar esto también:
http://www.delphifaq.com/faq/delphi/network/f236.shtml
Envía correos utilizando el cliente de correo por defecto del ordenador.
Si tienes mas de un adjunto puedes modificar esa parte con esto:
Código Delphi
[-]
ArchivosAdjuntos := TStringList.Create;
try
ArchivosAdjuntos.Add('C:\Fotos\Foto1.jpg');
ArchivosAdjuntos.Add('C:\Fotos\Foto2.jpg');
ArchivosAdjuntos.Add('C:\Fotos\Foto3.jpg');
SendMailMAPI('Prueba', 'Esto es una prueba', ArchivosAdjuntos, 'Pepito Perez', 'pepito.perez@gmail.com', 'Fulanito Ggarcia', 'fulanito.garcia@hotmail.com')
finally
ArchivosAdjuntos.Free;
end;
function TDMListados.SendMailMAPI(const Subject, Body:string; Adjuntos: TStrings; SenderName, SenderEMail, RecepientName, RecepientEMail: string): integer;
var
...
Archivo : string;
...
if Adjuntos.Count > 0 then
begin
GetMem(Attachments, SizeOf(TMapiFileDesc) * Adjuntos.Count);
for i := 0 to Adjuntos.Count - 1 do
begin
Archivo := Adjuntos[i];
Attachments[i].ulReserved := 0;
Attachments[i].flFlags := 0;
Attachments[i].nPosition := ULONG($FFFFFFFF);
Attachments[i].lpszPathName := StrNew(PChar(Archivo));
Attachments[i].lpszFileName := StrNew(PChar(ExtractFileName(Archivo)));
Attachments[i].lpFileType := nil;
end;
MapiMessage.nFileCount := Adjuntos.Count;
MapiMessage.lpFiles := @Attachments^;
end;
...