Author |
|
hmuscroft Groupie
![Groupie](forum_images/2_star_rating.gif)
Joined: 29 December 2009 Location: United Kingdom
Online Status: Offline Posts: 72
|
Posted: 28 January 2021 at 2:13am | IP Logged
|
|
|
Hi - I've (finally) finished integrating Gmail OAuth 2 into my WinForms desktop application and have spent several weeks jumping through all the hoops Google keep throwing at me - mainly involving making videos demonstrating my app working with Gmail.
Now they've asked me to demonstrate (in a video) my app deleting emails from the Gmail TRASH folder, showing that this also deletes them on Gmail (i.e. in a web browser).
The weird thing is... it doesn't!
So in my app, I call .SelectFolder("[Gmail]/Trash"), then I can read the emails and delete them from the Trash folder.
In my app they have now GONE. If I re-read all the emails in the Gmail Trash folder, they've disappeared - as expected. Great. HOWEVER... they're all still there in the Gmail.com web browser.
It seems that deleting emails from GMAIL TRASH via IMAP actually does NOT get rid of them.
Have you come across this before please? Do you know what GMAIL does with emails once they're deleted from the TRASH folder? Do they go somewhere else or get flagged differently so that the MAILBEE.NET IMAP component doesn't see them any more?
Any idea how to delete emails from the Gmail Trash folder?
Many thanks for your help!
Kind Regards,
Hedley
|
Back to Top |
|
|
hmuscroft Groupie
![Groupie](forum_images/2_star_rating.gif)
Joined: 29 December 2009 Location: United Kingdom
Online Status: Offline Posts: 72
|
Posted: 28 January 2021 at 2:56am | IP Logged
|
|
|
OK, I think I can answer this myself.
Stepping through the code, I was ONLY calling IMAP.DeleteMessages(...).
For most servers, calling this on an email in the TRASH folder seems to permanently delete it. With Gmail it doesn't - although goodness knows where it puts it?!
I needed to call IMAP.DeleteMessages(...) followed by IMAP.Expunge(...) to permanently delete messages from the trash.
Please can you confirm that this is correct?
|
Back to Top |
|
|
Igor AfterLogic Support
![AfterLogic Support](forum_images/5_star_rating.gif)
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6082
|
Posted: 28 January 2021 at 3:02am | IP Logged
|
|
|
Yes that's right. To quote DeleteMessages method documentation page:
Quote:
This method just sets "\Deleted" flag for the specified messages. To purge deleted messages permanently, call Expunge(String, Boolean) method or explicitly unselect the folder using Close(Boolean) method. |
|
|
--
Regards,
Igor, Afterlogic Support
|
Back to Top |
|
|