getEntityAsText (NotesMIMEEntity - JavaScript)

Gets the headers and content of a MIME entity as text.

Defined in

NotesMIMEEntity

Syntax

getEntityAsText(stream:NotesStream) : void

getEntityAsText(stream:NotesStream, headerFilters:java.util.Vector) : void

getEntityAsText(stream:NotesStream, headerFilters:java.util.Vector, inclusive: boolean) : void

Parameter Description
stream Output medium for the text.
headerFilters Names of headers that may be present in the MIME entity. See the next parameter.
inclusive Specify:
  • true to include headers that match the names in the previous parameter.
  • false (default) to exclude headers that match the names in the previous parameter.

Usage

Any encoding is left in place.

This method excludes any leading boundary string defined by a multipart parent.

This method sets the stream Position at end of stream.

Examples

This button gets the headers and content of a MIME entity, including only the From and Subject headers.
// Do not automatically convert MIME to rich text
session.setConvertMIME(false);
var mime:NotesMIMEEntity = currentDocument.getDocument().getMIMEEntity();
if (mime != null) {
	var filter = new java.util.Vector();
	filter.addElement("Subject");
	filter.addElement("From");
	var stream:NotesStream = session.createStream();
	mime.getEntityAsText(stream, filter, true);
	stream.setPosition(0); // must reset the stream position
	requestScope.status = stream.readText();
} else {
	requestScope.status = "Not MIME";
}
// Restore conversion
session.setConvertMIME(true);