Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JGraph
>
Tutorial
> List mail folders
Get all the mail folders in the specified user's mailbox.
import java.util.List; import com.independentsoft.graph.GraphClient; import com.independentsoft.graph.GraphException; import com.independentsoft.graph.mails.MailFolder; import com.independentsoft.graph.queryoptions.Query; public class Console { public static void main(String[] args) { try { GraphClient client = new GraphClient(); client.setClientId("63333333-209e-454e-b7bd-55a4d201270f"); client.setTenant("independentsoft.onmicrosoft.com"); client.setClientSecret("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); Query query = new Query(); query.setTop(999); List
folders = client.getMailFolders("info@independentsoft.onmicrosoft.com", query); for (MailFolder folder : folders) { System.out.println("Id: " + folder.getId()); System.out.println("DisplayName: " + folder.getDisplayName()); System.out.println("StandardFolder: " + folder.getStandardFolder()); System.out.println("---------------------------------------------"); } } catch (GraphException e) { System.out.println(e.getCode()); System.out.println(e.getMessage()); e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*