简体   繁体   中英

How to programmatically delete mail from Google Apps Mail using Google API ver 2 for .NET

I have created a dummy mail to create Empty Label in Google APPs mail. Now I want to remove this dummy mail after label is created?

How can I do that?

Take the following with a grain of salt. This is far outside my own experience, but I have to take a crack at that bounty!

A cursory look at the available Google APIs tells me that you're out of luck for doing this programmatically with their APIs. But I may be looking at the wrong set of APIs.

What you can do is delete mail through IMAP. How IMAP functions apply to Gmail is given here

How to setup IMAP for google apps/gmail here

Unfortunately, there doesn't appear to be a way to set that setting for an entire domain. If that's a problem, then you may have to use some kind of web automation product. And if you're really crazy, you could roll your own simple automaton that does only the required clicking (fill in username and password, then two clicks to enable imap).

So if you can manage to set up IMAP on the accounts that have the dummy mail, and have a way to get the username and password of each afflicted account, then you can use an IMAP library for .NET to delete them. See:
Accessing Imap in C#
using c# .net librarires to check for IMAP messages from gmail servers

Seems like it ought to be simpler, right? Sad face.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM