Chapter 3 DynaScript Predefined Objects
Represents file, data, or document attachments to incoming mail pieces.
attachment.propertyName
Use the attachment object to manipulate incoming mail piece attachments. You can view and save attachments in different formats.
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();
-->
Copyright © 1999 Sybase, Inc. All rights reserved. |
![]() |