简体   繁体   中英

How to create Empty Label without any entries in it using Google Mail API Ver 2?

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

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