Chapter 3 DynaScript Predefined Objects


mailPiece object (outgoing)

Object

Represents a mail piece that is to be sent via SMTP.

Syntax

To use a mailPiece property:

mailPiece.propertyName 

To use a mailPiece method:

mailPiece.MethodName( parameter ) 

Description

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.

Example

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() );
}

See also

"attachment object"

"mailPiece object (incoming)"

"mailList object"

"recipient object"

 


Copyright © 1999 Sybase, Inc. All rights reserved.