This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see How to Migrate to InterSystems IRIS, available on the WRC Distributions page (login required).


class %Net.MIMEPart extends %Library.RegisteredObject

%Net.MIMEPart holds a MIME message part

Property Inventory (Including Private)

Method Inventory (Including Private)


property Body as %RegisteredObject;
The body of the attachment as a stream. Either Parts must contain MIMEParts or Body must be specified, but not both.
Property methods: BodyGet(), BodyGetSwizzled(), BodyIsValid(), BodyNewObject(), BodySet()
property Boundary as %String);
Boundary to used to separate parts of the message. If none is specified, a default is created.
Property methods: BoundaryDisplayToLogical(), BoundaryGet(), BoundaryIsValid(), BoundaryLogicalToDisplay(), BoundaryLogicalToOdbc(), BoundaryNormalize(), BoundarySet()
property ContentCharset as %String) [ Calculated ];
If the ContentType starts with 'text/' then this is the charset to encode the contents with. This is actually specified in the MIME Content-Type header with something like:

Content-Type: text/html; charset=UTF-8

You must set this property after you set the ContentType or it will overwrite this value.

Property methods: ContentCharsetDisplayToLogical(), ContentCharsetGet(), ContentCharsetIsValid(), ContentCharsetLogicalToDisplay(), ContentCharsetLogicalToOdbc(), ContentCharsetNormalize(), ContentCharsetSet()
property ContentId as %String);
The normalized content-id. Any leading or trailing whitespace and enclosing <> are removed.
Property methods: ContentIdDisplayToLogical(), ContentIdGet(), ContentIdIsValid(), ContentIdLogicalToDisplay(), ContentIdLogicalToOdbc(), ContentIdNormalize(), ContentIdSet()
property ContentLocation as %String);
The normalized content-location. Any leading or trailing whitespace and comments are removed.
Property methods: ContentLocationDisplayToLogical(), ContentLocationGet(), ContentLocationIsValid(), ContentLocationLogicalToDisplay(), ContentLocationLogicalToOdbc(), ContentLocationNormalize(), ContentLocationSet()
property ContentTransferEncoding as %String (VALUELIST = ",base64,quoted-printable,7bit,8bit,binary");
Content-Transfer-Encoding header. Can be one of "base64", "quoted-printable", "7bit", "8bit", "binary".
Property methods: ContentTransferEncodingDisplayToLogical(), ContentTransferEncodingGet(), ContentTransferEncodingIsValid(), ContentTransferEncodingLogicalToDisplay(), ContentTransferEncodingLogicalToOdbc(), ContentTransferEncodingNormalize(), ContentTransferEncodingSet()
property ContentType as %String) [ Calculated ];
Sets/gets the 'Content-Type:' MIME header. A Content-Type specifies the media type of the Body data. A Content-Transfer-Encoding header may be used to indicate any additional content coding applied to the type.
Property methods: ContentTypeAttributesDisplayToLogical(), ContentTypeAttributesGet(), ContentTypeAttributesIsValid(), ContentTypeAttributesLogicalToDisplay(), ContentTypeAttributesLogicalToOdbc(), ContentTypeAttributesNormalize(), ContentTypeAttributesSet(), ContentTypeDisplayToLogical(), ContentTypeGet(), ContentTypeIsValid(), ContentTypeLogicalToDisplay(), ContentTypeLogicalToOdbc(), ContentTypeNormalize(), ContentTypeSet()
property PartOwnedStream as %Boolean;
If PartOwnedStream is true, then the part owns the stream and should cleasr it when the part is deleted.
Property methods: PartOwnedStreamDisplayToLogical(), PartOwnedStreamGet(), PartOwnedStreamIsValid(), PartOwnedStreamLogicalToDisplay(), PartOwnedStreamNormalize(), PartOwnedStreamSet()
property Parts as list of %Net.MIMEPart;
Parts of a multipart message. Either Parts must contain MIMEParts or Body must be specified, but not both.
Property methods: PartsBuildValueArray(), PartsCollectionToDisplay(), PartsCollectionToOdbc(), PartsDisplayToCollection(), PartsGet(), PartsGetObject(), PartsGetObjectId(), PartsGetSwizzled(), PartsIsValid(), PartsOdbcToCollection(), PartsSet(), PartsSetObject(), PartsSetObjectId()


private method %OnClose() as %Status
Make sure stream is Clear'ed when this part is closed
method %OnNew(body As %CSP.BinaryStream = "") as %Status
Optionally initialize the body (and possibly the headers) during construction.
method BodySet(body As %CSP.BinaryStream = "") as %Status
Set the body of the attachment to a stream. If the stream contains a Headers attribute, this attribute is used to initialize the headers of the MIME part. The %CSP.BinaryStream that is returned by the CSP engine is an example of such a stream with Headers attribute.
method BoundaryGet() as %String
method ClearHeaders() as %Status
Clear the list of headers
method ContentCharsetGet() as %String
method ContentCharsetSet(charset As %String) as %Status
method ContentIdSet(value As %String) as %Status
method ContentLocationSet(value As %String) as %Status
method ContentTransferEncodingGet() as %String
method ContentTransferEncodingSet(value As %String) as %Status
method ContentTypeGet() as %String
method ContentTypeSet(contenttype As %String) as %Status
method GetContentTypeAttribute(name As %String)
Return an attribute of a previously stored Content-Type.
method GetHeader(name As %String, Output originalName As %String) as %String
Lookup a previously set header. The lookup is not case sensitive. However, the original name is returned.
method NextHeader(name As %String) as %String
Get the next header based on the upper case key used to store the headers.
classmethod NormalizeContentId(contentId As %String) as %String
Strip enclosing <> from Content-Id header. Input must already be stripped of lleading and trailing whitespace
classmethod NormalizeContentLocation(contentLocation As %String) as %String
Strip whitespace and comments from the Content-Location header. Input must already be stripped of lleading and trailing whitespace
method RemoveHeader(name As %String)
Remove a header to the MIME part.
method SetHeader(name As %String, value As %String)
Add a header to the MIME part. The basic Content headers that you may want are covered by properties of this class: Content-Type, Content-Transfer-Encoding, Content-Id and Content-Location.

Inherited Members

Inherited Methods (Including Private)