getNthHeader (NotesMIMEEntity - JavaScript)

Returns a header associated with a MIME entity.

Defined in

NotesMIMEEntity

Syntax

getNthHeader(headerName:string) : NotesMIMEHeader

getNthHeader(headerName:string, instance:int) : NotesMIMEHeader

Parameter Description
headerName The name of the header.
instance The header instance where 1 is the first header. Defaults to 1.
Return value Description
NotesMIMEHeader The MIME header or null.

Usage

Multiple headers of the same name exist in the order they were last written.

Examples

This button gets all the entities from the end of the last branch of a multipart entity in reverse order.
// Do not automatically convert MIME to rich text
session.setConvertMIME(false);
var mime:NotesMIMEEntity = currentDocument.getDocument().getMIMEEntity();
if (mime != null) {
	var header:NotesMIMEHeader = mime.getNthHeader("Subject");
	if (header != null) {
		requestScope.status = "Subject: " + header.getHeaderVal();
	}
		requestScope.status = "No Subject header";
	
} else {
	requestScope.status = "Not MIME";
}
// Restore conversion
session.setConvertMIME(true);