Re: Checking if an email has an attachmente (Problem)

Giganews Newsgroups
Subject: Re: Checking if an email has an attachmente (Problem)
Posted by:  Andrew Lockwood (andrew.lockwo…@fsbdial.co.uk)
Date: Fri, 6 Feb 2004

Not sure that I fully understand your problem, but you need to do:

idMsg := TidMessage.Create(Self);
>    idMsg.Clear;
>    Mail.Retrieve(nMsg,idMsg);
>    X := 0;
>    for x := 0 to idMsg.MessageParts.Count-1 do
          if  (idMessageParts[x] is TIdAttachment) then
              begin
                    ... put your code in here ...
              end;

This works for me anyway!

Andrew Lockwood

"[ Eduardo Tavares ]" <davar…@earthlink.net> wrote in message
news:F3A4AE610B90E240davar…@earthlink.net...
> Hi!
> I am having this problem to check if there is an attachment to a email.
>    idMsg := TidMessage.Create(Self);
>    idMsg.Clear;
>    Mail.Retrieve(nMsg,idMsg);
>    X := 0;
>    for x := 0 to idMsg.MessageParts.Count-1 do This Line shows 0 when I am
> debuging my app even if the email I am checking has an attachment.
>
> What's the problem please?
>
> --
> Thank You
> Eduardo Tavares

Replies

In response to

Checking if an email has an attachmente (Problem) posted by [ Eduardo Tavares ] on Fri, 30 Jan 2004