Chapter 3 DynaScript Predefined Objects
Represents a mail piece that is to be sent via SMTP.
To use a mailPiece property:
mailPiece.propertyName
To use a mailPiece method:
mailPiece.MethodName( parameter )
Use the mailPiece constructor to create an outgoing mail piece object that represents a piece of outgoing mail. The syntax is:
mailPiece = new MailPiece( );
You can also create outgoing mail pieces by calling the Forward, Redirect or Reply method on an incoming mail piece object.
This example creates and sends a simple mail piece with an attachment:
mp = new MailPiece();
mp.subject = "This is my subject text";
mp.from = "elmo@sybase.com";
mp.body = "This is my mail piece body.";
mp.smtpHost = "mail.sybase.com";
mp.AddRecipient( "theGrouch@sybase.com");
mp.AttachDocument( "attachment.gif" );
if( !mp.Send() ) {
document.writeln( mp.GetErrorCode() );
document.writeln( mp.GetErrorInfo() );
}
Copyright © 1999 Sybase, Inc. All rights reserved. |