Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delete e-mail from server using ReceiveMail
#1
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!
#2
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
#3
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
Code:
Copy      Help
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
#4
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.
#5
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)