Chapter 3 DynaScript Predefined Objects


mail piece properties (incoming)

The incoming mail piece object has these properties:

attachments property

Syntax

mailPiece.attachments

Attributes

This property is read-only.

Description

A list of attachments contained with the incoming mail piece.

Return

List of attachment objects.

Example

This example displays the names of all attachments in incoming mail piece number 7:

<!--SCRIPT
mlist = new MailList ("mail.sybase.com", "elmo", "dynamo", "elmo@mail.sybase.com");
mlistItem = mlist[7]
lmilstItem.Retrieve()
for ( i in mlistItem.attachment );{P
document.WriteLn( mlistitem.attachments[i].name;
}
mlist.Disconnect();
-->

See also

"mailList object".

body property

Syntax

mailPiece.body 

Attributes

This property is read-only.

Description

The body or content text of the incoming mail piece. This property is available only after doing a Retrieve.

Return

String.

Example

This example displays the body of an incoming mail piece:

<!--SCRIPT
mlist = new MailList ("mail.sybase.com", "elmo", "dynamo", "elmo@mail.sybase.com");
mlistitem = mlist[1];
mlistitem.Retrieve();
document.WriteLn( mlistitem.body );
mlist.Disconnect();
-->

See also

"mailList object".

"mailPiece object (outgoing)".

from property

Syntax

mailPiece.from 

Attributes

This property is read-only.

Description

The person from whom the mail piece originated.

Return

String.

Example

This example display the address from which the mail piece originated:

<!--SCRIPT
mlist = new MailList ("mail.sybase.com", "elmo", "dynamo", "elmo@mail.sybase.com");
mlistitem = mlist[4];
document.WriteLn( mlistitem.from );
mlist.Disconnect();
-->

See also

"mailList object".

headers property

Syntax

mailPiece.headers 

Attributes

This property is read-only.

Description

The ARPA message headers. These are the unprocessed header fields from the mail piece.

Return

String.

Example

This example displays the headers:

<!--SCRIPT
mlist = new MailList ("mail.sybase.com", "elmo", "dynamo", "elmo@mail.sybase.com");
mlistitem = mlist[4];
document.WriteLn( mlistitem.headers );
mlist.Disconnect();
-->

See also

"mailList object".

"mailPiece object (outgoing)".

recipients property

Syntax

mailPiece.recipients 

Attributes

This property is read-only.

Description

The recipients of the incoming mail piece.

Return

List of recipient objects.

Example

This example displays a list of the recipients for the incoming mail piece:

<!--SCRIPT
mlist = new MailList ("mail.sybase.com", "elmo", "dynamo", "elmo@mail.sybase.com ");
mlistitem=mlist[2];
mlistitem.Retrieve();
for (i in mlistitem.recipients ){
document.WriteLn(mlistitem.recipients[i]);
}
mlist.Disconnect();
-->

See also

"mailList object".

"mailPiece object (outgoing)".

replyTo property

Syntax

mailPiece.replyTo 

Attributes

This property is read-only.

Description

Who the recipient of the mail piece should reply to. This is a list of recipient objects. If this field exists, the reply method responds to the recipients listed here instead of to addresses specified in the from field.

Return

List of recipient objects.

Example

This example displays the address of the individual to whom the mail piece is sent if the Reply method is used. If the replyTo property is null, the mail piece will be sent to the address held in the from property

<!--SCRIPT
mlist = new MailList ("mail.sybase.com", "elmo", "dynamo", "elmo@mail.sybase.com ");
mlistitem=mlist[2];
mlistitem.Retrieve();
for (i in mlistitem.replyTo ){
document.WriteLn(mlistitem.replyTo[i]);
}
mlist.Disconnect();
-->

See also

"mailList object"

"mailPiece object (outgoing)"

sender property

Syntax

mailPiece.sender 

Attributes

This property is read-only.

Description

The address from where the mail piece was sent. This is not necessarily the same address as the from field (in the case where a mail piece has been redirected).

Return

String.

Example

This example indicates if the mail piece was sent directly by the author or by a "sender":

<!--SCRIPT
mlist = new MailList ("mail.sybase.com", "elmo", "dynamo", "elmo@mail.sybase.com ");
mlistitem = mlist[2];
mlistitem.Retrieve();
if (mlistitem.sender(true)){
document.WriteLn("This mail piece was sent from " + mlistitem.sender + "for " + mlistitem.from);
}else{
document.WriteLn("There was no sender property on this mail piece");
}
mlist.Disconnect();
-->

See also

"mailList object".

"mailPiece object (outgoing)".

size property

Syntax

mailPiece.size 

Attributes

This property is read-only.

Description

The size (bytes) of the incoming mail piece.

Return

Integer.

Example

This example displays the size of the mail piece:

<!--SCRIPT
mlist = new MailList ("mail.sybase.com", "elmo", "dynamo", "elmo@mail.sybase.com");
mlistitem = mlist[9];
mlistitem.Retrieve();
document.WriteLn( "size: " + mlistitem.size );
mlist.Disconnect();
-->

See also

"mailList object"

"mailPiece object (outgoing)"

subject property

Syntax

mailPiece.subject 

Attributes

This property is read-only.

Description

The subject of the incoming mail piece.

Return

String.

Example

This example displays the subject of the mail piece:

<!--SCRIPT
mlist = new MailList ("mail.sybase.com", "elmo", "dynamo", "elmo@mail.sybase.com");
mlistitem = mlist[1];
document.WriteLn( mlistitem.subject );
mlist.Disconnect();
-->

See also

"mailList object"

"mailPiece object (outgoing)"

 


Copyright © 1999 Sybase, Inc. All rights reserved.