imap.delete(session, message) Last updated: 01. May 2026

API only function

Deletes a specific message from the inbox.

See also: Send mail from API function Sending forms by e-mail

Parameters

Name Type Description
session object Imap session from imap.connect()
message object Message object of message to delete.
Use the "GetMessage" method to retreive this.

Returns

Null

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
let i = imap.connect(config);
let count = imap.getCount(i);
if (count > 0) {
    var msg = imap.getMessage(i, 0);
    imap.delete(i, msg);
    return { "deleted" : msg };
}
return "No messages in inbox";