Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Dec : Found Problem - Re: Problems adding more than one recipient to a TIdMessage

www.cryer.info
Managed Newsgroup Archive

Found Problem - Re: Problems adding more than one recipient to a TIdMessage

Subject:Found Problem - Re: Problems adding more than one recipient to a TIdMessage
Posted by:"Paul Coshott" (pa..@pacsoftware.com.au)
Date:Thu, 13 Dec 2007 16:21:00

>      with IdMessage1.Recipients.Add do begin
>        sEMailRecip := strReplace(tblCustEMail.AsString, ',', ';');
>        if Pos(';', sEMailRecip) = 0 then begin
>          Address := strTrim(sEMailRecip);
>          Name := strTrim(sEMailRecip);
>        end else begin
>          zEMailLeft := sEMailRecip;
>          while zEMailLeft <> '' do begin
>            if Pos(';', zEMailLeft) = 0 then begin
>              Address := strTrim(zEMailLeft);
>              Name := strTrim(zEMailLeft);
>              zEMailLeft := '';
>            end else begin
>              zEMail := strLeft(zEMailLeft, Pos(';', zEMailLeft)-1);
>              Address := strTrim(zEMail);
>              Name := strTrim(zEMail);
>              zEMailLeft := strRight(zEMailLeft,
> Length(zEMailLeft)-Pos(';', zEMailLeft));
>            end;
>          end; //while
>        end;
>      end;

All sorted. I realised I was only running the Add method once, so it was
overwriting each time.

Cheers,
Paul

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive