Thread View: borland.public.cppbuilder.internet.socket
2 messages
2 total messages
Started by Andre' Burke
Tue, 03 Oct 2006 07:42
IMAP problem
Author: Andre' Burke
Date: Tue, 03 Oct 2006 07:42
Date: Tue, 03 Oct 2006 07:42
42 lines
1842 bytes
1842 bytes
Hi all,
I am using Indy 9 on BDS 2006.
I have written an application that uses the TIdIMAP4 component to connect to
an MS-Exchange mail server.
I am able to open a mailbox and retrieve a message from inside it but when I
try to delete the message once I am finished with it, the DeleteMsgs method
returns false.
The call to ExpungeMailBox is successful, but it doesnt do anything because
the call to DeleteMsgs failed.
I am not sure if I am using the method correctly and I cannot find any
examples on the internet.
I include a code snippet.
Regards,
Andre'
{
if (!IdIMAP41->SelectMailBox("barney"))
{
Memo1->Lines->Add("Unable to access mailbox");
}
int ii[1];
ii[0] = 1;
if (IdIMAP41->DeleteMsgs(ii,1))
{
Memo1->Lines->Add("Message Deleted");
}
else
{
Memo1->Lines->Add("Unable to delete message");
}
if (!IdIMAP41->ExpungeMailBox())
{
Memo1->Lines->Add("Could not expunge mailbox");
}
}
Re: IMAP problem
Author: Remy Lebeau (TeamB)
Date: Tue, 03 Oct 2006 08:27
Date: Tue, 03 Oct 2006 08:27
32 lines
1765 bytes
1765 bytes
"Andre' Burke" <no.spam@spam.no> wrote in message
news:45221456@newsgroups.borland.com...
> I am able to open a mailbox and retrieve a message from inside it but when
I
> try to delete the message once I am finished with it, the DeleteMsgs
method
> returns false.
The only way that can happen is if you are passing invalid parameters.
> I am not sure if I am using the method correctly
You are not.
> int ii[1];
> ii[0] = 1;
> if (IdIMAP41->DeleteMsgs(ii,1))
That is not correct. The second parameter is the index of the last item in
the array, not the number of items in the array. You need to specify 0
instead of 1, ie:
if( IdIMAP41->DeleteMsgs(ii, 0) )
Alternatively, use the EXISTINGARRAY macro instead:
if( IdIMAP41->DeleteMsgs(EXISTINGARRAY(ii)) )
Gambit
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads