Chapter 3 DynaScript Predefined Objects


attachment object

Object

Represents file, data, or document attachments to incoming mail pieces.

Syntax

attachment.propertyName

Description

Use the attachment object to manipulate incoming mail piece attachments. You can view and save attachments in different formats.

Example

This script saves a mail piece file attachments to a hard drive:

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

for( i in mlistitem.attachments ) {
attach = mlistitem.attachments[i];
filesave = attach.SaveAsFile( "g:\\temp\\Dynamo\\" + attach.name );
}
if (filesave) {
document.WriteLn( "The file has been saved." );
}
mlist.Disconnect();
-->

See also

"mailList object"

"mailPiece object (incoming)"

"mailPiece object (outgoing)"

"recipient object"

 


Copyright © 1999 Sybase, Inc. All rights reserved.