IRISLIB database
MailMessagePart Class Reference
Inheritance diagram for MailMessagePart:
Collaboration diagram for MailMessagePart:

Public Member Functions

 AttachEmail (_.Net.MailMessage mailmsg)
 Attach email message to current message.
 
_.Library.Status AttachFile (_.Library.String Dir, _.Library.String File, _.Library.Boolean isBinary, _.Library.String charset, _.Library.Integer count)
 Attach file to this message as another MIME part. More...
 
_.Net.MailMessagePart AttachNewMessage ()
 Attach message to current message. More...
 
_.Library.Status AttachStream (_.Stream.Object stream, _.Library.String Filename, _.Library.Boolean isBinary, _.Library.String charset, _.Library.Integer count)
 Attach the contents of a stream to this message as another MIME part. More...
 
_.Library.String GetAttribute (_.Library.String header, _.Library.String name)
 
_.Library.String GetFileName ()
 If message is associated with an attached file, get the filename.
 
def __init__ (self)
 If message is NOT multipart, this indicates whether message to be sent. More...
 
- Public Member Functions inherited from SwizzleObject
_.Library.Status OnJournalObject (_.Library.Integer tranid, _.Library.Integer jrnid, _.Library.String filter)
 This callback method is invoked by the <METHOD>JournalObject</METHOD> method to. More...
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Public Attributes

 BinaryData
 binary data if message is BINARY and is NOT multipart More...
 
 Charset
 Then default is utf-8 on Unicode systems and the system default on 8-bit systems. More...
 
 ContentTransferEncoding
 Content-Transfer-Encoding header. More...
 
 ContentType
 Sets the Content-Type header. More...
 
 Dir
 directory for attachments More...
 
 FileName
 Filename if message is associated with attached file. More...
 
 Headers
 Array of header names and their values. More...
 
 InlineAttachment
 If Filename specified and InlineAttachment property is true, then attachment will have. More...
 
 Is7bit
 
 IsAlternative
 
 IsBase64
 
 IsBinary
 If message is NOT multipart, this indicates whether message has text or binary data. More...
 
 IsHTML
 if message is NOT multipart and is text, this indicates whether message is in HTML format More...
 
 IsMultiPart
 If set, this message part (which may be the entire message) is made up out of parts. More...
 
 MultiPartType
 Type of MultiPart to declare, e.g. More...
 
 Parts
 If IsMultiPart=1 (true), Parts is an array of the parts of a multipart messsage. More...
 
 TextData
 text data if message is NOT binary and is NOT multipart More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SerialObject
_.Library.String LogicalToOdbc (_.Library.String val)
 Converts the serial state of this serial object to a delimited string. More...
 
_.Library.String OdbcToLogical (_.Library.String val)
 Converts the value of an incoming delimited string to a serialized state. More...
 
- Static Public Attributes inherited from SerialObject
 ODBCDELIMITER = None
 A serial object is converted to a delimited string containing the. More...
 
 SERIALDELIMITER = None
 This parameter specifies the delimiter character used when created a serialized. More...
 
 VALIDIFNULL = None
 If true, ValidateObject will return $$$OK for instances that are null as determined by IsNull(). More...
 
- Static Public Attributes inherited from SwizzleObject
 DEFAULTCONCURRENCY = None
 DEFAULTCONCURRENCY is the default value for the concurrency formal argument. More...
 
 JOURNALSTREAM = None
 If OBJJOURNAL is true then the value of the JOURNALSTREAM parameter defines whether or not. More...
 
 OBJJOURNAL = None
 if OBJJOURNAL is TRUE then inserts, updates and deletes will be logged in ^OBJ.JournalT More...
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

For information on using this class, see Sending and Receiving Email.

Send an SMTP mail message or receive a MIME message using POP3.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

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.  

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.  

Reimplemented in MailMessage.

Member Function Documentation

◆ AttachFile()

_.Library.Status AttachFile ( _.Library.String  Dir,
_.Library.String  File,
_.Library.Boolean  isBinary,
_.Library.String  charset,
_.Library.Integer  count 
)

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.

◆ AttachNewMessage()

_.Net.MailMessagePart AttachNewMessage ( )

Attach message to current message.

Return oref of attached message, so more things can be attached to the attachment

◆ AttachStream()

_.Library.Status AttachStream ( _.Stream.Object  stream,
_.Library.String  Filename,
_.Library.Boolean  isBinary,
_.Library.String  charset,
_.Library.Integer  count 
)

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.

◆ GetAttribute()

_.Library.String GetAttribute ( _.Library.String  header,
_.Library.String  name 
)

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.

Member Data Documentation

◆ BinaryData

BinaryData

binary data if message is BINARY and is NOT multipart

 

◆ Charset

Then default is utf-8 on Unicode systems and the system default on 8-bit systems.



<property>Charset</property> determines the charset of the mail message part. <class>Net.SMTP</class> and <class>Net.POP3</class> handle <property>Charset</property> differently – see the appropriate class definition.  

◆ ContentTransferEncoding

ContentTransferEncoding

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".  

◆ ContentType

ContentType

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"  

◆ Dir

Dir

directory for attachments

 

◆ FileName

FileName

Filename if message is associated with attached file.

 

◆ Headers

Headers

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.  

◆ InlineAttachment

InlineAttachment

If Filename specified and InlineAttachment property is true, then attachment will have.

a content-disposition header with value inline.  

◆ Is7bit

Is7bit

◆ IsAlternative

IsAlternative

◆ IsBase64

IsBase64

◆ IsBinary

IsBinary

If message is NOT multipart, this indicates whether message has text or binary data.

 

◆ IsHTML

IsHTML

if message is NOT multipart and is text, this indicates whether message is in HTML format

 

◆ IsMultiPart

IsMultiPart

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  

◆ MultiPartType

MultiPartType

Type of MultiPart to declare, e.g.

"related","alternative"; default="mixed"

 

◆ Parts

Parts

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.  

◆ TextData

TextData

text data if message is NOT binary and is NOT multipart