views:

457

answers:

1

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?

+2  A: 

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:
http://mail.google.com/support/bin/answer.py?answer=77657

How to setup IMAP for google apps/gmail:
http://mail.google.com/support/a/google.com/bin/answer.py?answer=33384

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:
http://stackoverflow.com/questions/670183/accessing-imap-in-c
http://stackoverflow.com/questions/545724/using-c-net-librarires-to-check-for-imap-messages-from-gmail-servers

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

spirulence
Great answer amazing :). But what if any user disabled IMAP from settings?
Ismail
With my method, you'd have to re-enable it. You'd go behind the backs of your users (hopefully with their permissions), enable imap again, delete the emails you'd need to delete, and then disable imap when you're done.
spirulence