pop3.getHeader(options, identifier) Last updated: 16. Mar 2023
API only function
Gets the header fields for a single email message from POP3 server into a variable.
Parameters
Name | Type | Description |
---|---|---|
options | object | POP3 options object with hostname, port, useSsl, username and password. |
identifier | string or string[] | Mail identifier for message to get header fields for. |
Returns
Message header object with properties for subject, etc. but not the body and not the attachments.
If an array of identifiers was supplied, and array of objects will also be returned.
Example
Code example (JS)
JS is normal JavaScript either running in the browser or on the Docly™ server.// Configure options
let options = {
"hostname" : "serverhost",
"port" : 110,
"useSsl" : false,
"username" : "login",
"password" : "pass"
};
// Retreive header for specified message
let result = pop3.getHeader(options, identifier);
// Return message object
return result;