imap.getMessage(session, index / uid, [headersOnly], [folder]) Last updated: 26. Nov 2024

API only function

Retreives message by index from inbox using the provided imap session.

Parameters

Name Type Description
session object Session object from imap.connect()
index / uid number / string Index or UID of email to retreive.
headersOnly (optional) bool Default false, if true only header info is returned.
folder (optional) string Name of folder / tag to get message from.

Returns

An object with the retreived email.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
let session = imap.connect(config);
let msg = imap.getMessage(session, 0);