Board index » delphi » indy TidSMTP object: cannot send more than one attachment / multiple attachments

indy TidSMTP object: cannot send more than one attachment / multiple attachments

Hi All,

Using the SMTP and MESSAGE object I can send email with only one (1)
attachment fine. As soon as I try to attach more than one attachment,
the send method fails? I can do this using the DEMO application, so
clearly my code is wrong.
Could anyone please take a look at it?

Thanks for your help!!
-------------------------------------------------------------------------
  mail.Host := myini.ReadString('mailsettings','mailserver','localhost');
  mail.username := myini.ReadString('mailsettings','pop3id','localhost');
  mail.Password := myini.ReadString('mailsettings','pop3pw','localhost');

  msg.From.Address := myini.ReadString('mailsettings','address','');
  msg.From.DisplayName :=
myini.ReadString('mailsettings','displayname','');
  msg.From.Name := myini.ReadString('mailsettings','displayname','');
  msg.Subject := myini.ReadString(mailsection,'subject','');
  msg.Body.Add(myini.ReadString(mailsection,'body',''));
  msg.Recipients.Add.Address := 's...@adress.net';

  for teller := 0 to dumlist.count-1 do
  begin
    TIdAttachment.Create(msg.MessageParts,dumlist.Strings[teller]);
  end;

  try
  mail.Connect;
  mail.Send(msg);
  finally
    begin
      mail.Disconnect;
    end
  end;
-------------------------------------------------------------------------

So again, if I execute this code with ONLY ONE attachment, it works
ok.

 

Re:indy TidSMTP object: cannot send more than one attachment / multiple attachments


Can one download ftp files (instead http files) with
http://www.euromind.com/iedelphi/iedownload/ TIEDownload component?
If I try so, it stops after "Beginning to download data..." is outputed at
the DownloadDemo example (no more messages are printed).

In general: Is this component a higher abstract level as using TidFTP or
TidHTTP?
The relationship is not very clear to me, would appretiate it very much if
someone could explain.

Other Threads