Posts: 1,058
Threads: 367
Joined: Oct 2007
Dear Gintaras,
I understand that ReceiveMail may be used to delete messages from server, using flag 2. I am wondering whether it is possible to confirm each individual e-mail before it is deleted, since it seems that ReceiveMail deletes as a whole.
Is it likely that statement in Pop3Mail.RetrieveMessages
Quote:if(mc and flags&2) for(i 1 mc.Count+1) p.DeleteMessage(i)
has to be modified accordingly?
Many thanks. Best regards!
Posts: 12,072
Threads: 140
Joined: Dec 2002
Yes. Clone Pop3Mail.RetrieveMessages to Pop3Mail.RetrieveMessages2 and modify the p.DeleteMessage line.
Or without cloning:
Pop3Mail p.Connect(...)
MailBee.Messages mc=p.RetrieveMessages() ;;no flag 2
if(mc) for(i 1 mc.Count+1) p.DeleteMessage(i)
p.Disconnect
Posts: 1,058
Threads: 367
Joined: Oct 2007
Many thanks. I have already found it, Perfect!
Nevertheless, p.DeleteMessage(i) in the above example gives error. Therefore, I used the example given in QM "Email samples, namely :".
Macro
temp2
Pop3Mail pp.Connect(0x100 "...")
MailBee.Message mm; int i
for i 1 pp.p.MessageCount+1
,mm=pp.p.RetrieveSingleMessageHeaders(i 0) ;;this is MailBee.POP3 object's function
,out mm.Subject
,;pp.p.DeleteMessage(i) ;;use this to delete message from server
pp.Disconnect
Best Regards
Posts: 1,058
Threads: 367
Joined: Oct 2007
Dear Gintaras,
I would appreciate it if you could kindly elaborate a bit on 0x200 flag (process events) of ReceiveMail family of routines. An example will be highly appreciated.
Many thanls in advance.
Posts: 12,072
Threads: 140
Joined: Dec 2002
While receiving email, process Windows messages and COM events.
Use this flag, for example, when calling this function in a thread with a dialog. Without it the dialog hangs temporarily.
Also, the MailBee.POP3 object (member variable p) will fire COM events itself.
Flag 0x100 also does the same.