imap.getMessage(session, index / uid, [headersOnly]) Last updated: 19. Feb 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.

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);