My working Indy-using code (Delphi 7) contains:

var
  Email:    TEmail;

procedure EmailAttach (FileName: string);
begin with Email do begin
  if FileExists(FileName)
    then TIdAttachment.Create(MailMessage.MessageParts, FileName)
    else ShowMessage (format ('Attachment "%s" not found', [FileName]));
end end;

Rainer

----- Original Message ----- 
From: "Gordon Waters" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, April 18, 2006 1:59 AM
Subject: Indy10 & Attachments


> Hi Delphi Fans
> 
> I am trying to use Indy10 (D2005 Pro) to send an email with an 
> attachment, I have searched a few places and keep getting the same code 
> to use.
> 
> TidAttachment.Create(IdMessage,'Name of Attachment');
> 
> However I keep getting a compile error, [Error] : E2034 Too many actual 
> parameters
> on the TidAttachment.Create line.
> 
> If I take off the name of the attachment it will compile, but errors 
> with an ABSTRACT error.
> 
> I have also tried variations of;
>  p := idMessage.MessageParts;
> 
>  idAttach := TidAttachment.Create(p,'My Attachment');
>  idAttach.ContentType := 'image/bmp';
>  idattach.FileName := 'My Attachment';
> 
> 
> but still get the too many actual parameters error.
> 
> So what I am doing wrong ?. All I would like to do is to attach a file/s 
> to an email using IDSMTP & IDMESSAGE.
> 
> 
> 
> Thanks
> 
> Gordon.
> 
> 
> 
> 
> 
> 
>
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to