LeTay
asked on
How to delete a POP3 message with Delphi ?
Delete method of TidPOP3 component
I retrieve a message from the POP server : idPOP3.Retrieve(N,M) where M is a TIdMessage
I process the message and then I delete it with idPop3.Delete(N)
But the message is still there !
I retrieve a message from the POP server : idPOP3.Retrieve(N,M) where M is a TIdMessage
I process the message and then I delete it with idPop3.Delete(N)
But the message is still there !
ASKER
Well, your answer looks very strange !
What should then perform the "delete" function of the TIdPOP3 component ?
On the other hand, I have another application doing the same and it works (accessing another email server)
What should then perform the "delete" function of the TIdPOP3 component ?
On the other hand, I have another application doing the same and it works (accessing another email server)
Yes, as you said... another!
Gmail do not allow this. And that is it. Try you app with "another" server.
Gmail do not allow this. And that is it. Try you app with "another" server.
ASKER
Well, nice, but not possible, I have to use gmail server
So the question now is, after processing all these incoming emails on gmail with POP3 component, how can I delete all theses messages programmatically ?
Thanks
So the question now is, after processing all these incoming emails on gmail with POP3 component, how can I delete all theses messages programmatically ?
Thanks
I point you to use IMAP protocol with gmail. Because IMAP works with folders - then one solution is to move message to trash (folder).
Harder solution is to use Gmail/Google api.
Harder solution is to use Gmail/Google api.
ASKER
Well, I configured the gmail account that I need to access from my application via the gmail interface
I activated (of course) the POP protocol and set the option that retrieved message must be deleted
But this does not seem to work
If I can't do all that with the POP protocol, is there a IMAP component for Delphi ?
I activated (of course) the POP protocol and set the option that retrieved message must be deleted
But this does not seem to work
If I can't do all that with the POP protocol, is there a IMAP component for Delphi ?
Indy have IMAP4 component. Look here on Emp forum little description by Remy. It is very similar to POP3 component but IMAP uses/lists folders.
Simple example of how to use: http://delphidevshare.blog spot.com/2 009/06/con necting-wi th-gmail-t hrough-ima p-with.htm l
...and Delphi email client project here.
Simple example of how to use: http://delphidevshare.blog
...and Delphi email client project here.
ASKER
Hello,
I was wrong about the fact that the mail was not deleted when retrieved (action by gmail, not my code) : it is, indeed !
So I can continue to use POP3
I was wrong about the fact that the mail was not deleted when retrieved (action by gmail, not my code) : it is, indeed !
So I can continue to use POP3
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
They sugget to use IMAP protocol. Pop hides once fetched message - and delete would not work after that.