Skip to content

Function: getEmailsFromFolder()

ts
function getEmailsFromFolder(client: Client, folderId: string): Promise<any>;

Defined in: src/ms-graph/outlook.ts:188

Get emails from a specific mail folder.

Parameters

ParameterTypeDescription
clientClientThe Microsoft Graph client.
folderIdstringThe ID of the folder.

Returns

Promise<any>

A list of emails from the folder.

Example

ts
const client = await getMsGraphClient(creds);
const folders = await getMailFolders(client);
const inbox = folders.find((f: any) => f.displayName === 'Inbox');
const emails = await getEmailsFromFolder(client, inbox.id);
console.log('Latest email:', emails[0].subject);

Matterway Assistant SDK Documentation