How to create Empty Label without any entries in it using Google Mail API?
Posted
by Pari
on Stack Overflow
See other posts from Stack Overflow
or by Pari
Published on 2010-03-23T08:22:42Z
Indexed on
2010/03/23
8:23 UTC
Read the original article
Hit count: 248
Hi,
I want to create an empty label in Google apps using Google Mail API. Using Below code:
MailItemService mailItemService = new MailItemService(domain, "Sample Migration Application");
mailItemService.setUserCredentials(userEmail, password);
MailItemEntry[] entries = new MailItemEntry[1];
entries[0] = new MailItemEntry();
entries[0].Labels.Add(new LabelElement("Empty Label"));
entries[0].BatchData = new GDataBatchEntryData();
entries[0].BatchData.Id = "0";
MailItemFeed feed = mailItemService.Batch(domain, username, entries);
Above code is not giving any error but not creating label also.
If i assign some more values to entries it work nicely but it result in cretion of mail inside Label (But i want empty label)
Can anyone help me out here?
Thanx
© Stack Overflow or respective owner