property ContentTransferEncoding as %String (VALUELIST = ",base64,quoted-printable,7bit,8bit");
Content-Transfer-Encoding header. Can be one of "base64", "quoted-printable", "7bit", "8bit".
Default is "base64 if IsBinary is true, toherwise default is "quoted-printable".
Sets the Content-Type header.
If IsBinary, defaults to "application/octet-stream"
If 'IsBinary && isHTML, defaults to "text/html"
If 'IsBinary && 'isHTML, defaults to "text/plain"
property Headers as array of %String (MAXLEN = 4096);
Array of header names and their values.
Note that Content-Transfer-Encoding, Content-Type and Content-Disposition are
automatically created and should not be included in the Headers array.
If message is NOT multipart, this indicates whether message to be sent
will be treated as a 7bit message that does not need encoding.
All body text must already be 7bit data and all lines must < 998 bytes in lenght.
When sending the message and IsBase64=1, then Is7bit is ignored.
Is7bit is deprecated. Use ContentTransferEncoding.
property IsAlternative as %Boolean [ Calculated ];
The IsAlternative property is only meaningful for multipart messages (IsMultiPart=1).
If IsAlternative=1, then Content-Type: multipart/alternative,
otherwise Content-Type: multipart/mixed.
IsAlternative is deprecated. Use MultiPartType
If message is NOT multipart, this indicates whether message to be sent
will be encoded as Base64 or quoted-printable.
When sending the message and Is7bit="", the encoding (IsBase64) defaults to 1
if IsBinary, else to 0.
IsBase64 is deprecated. Use ContentTransferEncoding.
property IsMultiPart as %Boolean [ InitialExpression = 0 ];
If set, this message part (which may be the entire message) is made up out of parts
which you need to process.
If 0, then message consists of a single part and either has text data or binary data
If IsMultiPart=1 (true), Parts is an array of the parts of a multipart messsage.
Normally each of these parts is a %Net.MailMessagePart.
However, if ContentType="message/rfc822", then Parts may only have one entry
which is a %Net.MailMessage object that represents an attached email message.
This attached message may be converted to a %Net.MailMessage object using the
GetAttachedEmail method of %Net.POP3.
Inherited description: This callback method is invoked by the %New() method to
provide notification that a new instance of an object is being created.
If this method returns an error then the object will not be created.
It is passed the arguments provided in the %New call.
When customizing this method, override the arguments with whatever variables and types you expect to receive from %New().
For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:
Method %OnNew(dob as %Date = "", name as %Name = "") as %Status
If instead of returning a %Status code this returns an oref and this oref is a subclass of the current
class then this oref will be the one returned to the caller of %New method.
Attach file to this message as another MIME part.
All files are sent as binary attachments by default.
However, a text file may be attached by passing the third
argument, isBinary, as 0. For text files, the charset
may be passed as the fourth argument.
The position in the Parts array of the message part that holds the file
is returned in the count reference argument. This count may be used to set
additional characteristics of the file such as Charset,
e.g. set msg.Parts.GetAt(count).Charset="iso-8859-1".
For example to send the file as a text file in charset iso-8859-2:
set status=message.AttachFile("d:\temp","test.txt",0,"iso-8859-1",.count)
if $$$ISERR(status) do handleError .....
Note that setting the Charset does not translate the file. Rather it just
specifies the charset that already describes the file's data.
Attach the contents of a stream to this message as another MIME part.
The attachment is considered a file attachment if Filename is specified.
Otherwise it is considered an inline attachment.
All attachments are sent as binary attachments by default.
However, a text attached may be attached by passing the third
argument, isBinary, as 0. For text attachments, the charset
may be passed as the fourth argument.
The position in the Parts array of the message part that holds the file
is returned in the count reference argument. This count may be used to set
additional characteristics of the file such as Charset,
e.g. set msg.Parts.GetAt(count).Charset="iso-8859-1".
For example to send the attachememt as a text file in charset iso-8859-2:
set status=message.AttachFile(myCharacterStream,"test.txt",0,"iso-8859-1",.count)
if $$$ISERR(status) do handleError .....
Note that setting the Charset does not translate the attachment. Rather it just
specifies the charset that already describes the file's data.
Call this method with a header value, for example, "content-disposition" and
the name of an attribute, for example, "filename"
to obtain the value of the MIME attribute for this message part.
This only works after a message has been received in POP3 not when a message
is being composed in SMTP.