Chapter 3 DynaScript Predefined Objects
The incoming mail piece
object
has these properties:
mailPiece.attachments
This property is read-only.
A list of attachments contained with the incoming mail piece.
List of attachment objects.
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();
-->
mailPiece.body
This property is read-only.
The body or content text of the incoming mail piece. This property is available only after doing a Retrieve.
String.
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();
-->
"mailPiece object (outgoing)".
mailPiece.from
This property is read-only.
The person from whom the mail piece originated.
String.
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();
-->
mailPiece.headers
This property is read-only.
The ARPA message headers. These are the unprocessed header fields from the mail piece.
String.
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();
-->
"mailPiece object (outgoing)".
mailPiece.recipients
This property is read-only.
The recipients of the incoming mail piece.
List of recipient objects.
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();
-->
"mailPiece object (outgoing)".
mailPiece.replyTo
This property is read-only.
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.
List of recipient objects.
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();
-->
mailPiece.sender
This property is read-only.
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).
String.
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();
-->
"mailPiece object (outgoing)".
mailPiece.size
This property is read-only.
The size (bytes) of the incoming mail piece.
Integer.
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();
-->
mailPiece.subject
This property is read-only.
The subject of the incoming mail piece.
String.
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();
-->
Copyright © 1999 Sybase, Inc. All rights reserved. |