Chapter 3 DynaScript Predefined Objects


mailList methods

The mailList object has these methods:

Disconnect method

Syntax

mailList.Disconnect( [deleteMarkedPieces] )

Description

Disconnects from the mail server. The optional parameter deleteMarkedPieces indicates whether or not mail pieces marked for deletion should be deleted from the mail server at the time of disconnect. The default is true.

Return

Boolean indicating if the disconnect was successful.

Example

This example connects and then disconnects from the mail server:

<!--SCRIPT 
mlist = new MailList ("mail.sybase.com", "elmo", "secret", "elmo@mail.sybase.com ");
if( !mlist.Disconnect() ) {
document.writeln( mlist.GetErrorCode() );
document.writeln( mlist.GetErrorInfo() );
}
-->

See also

"mailPiece object (incoming)".

"mailPiece object (outgoing)".

GetErrorCode method

Syntax

mailList.GetErrorCode( )

Description

Returns a code representing the most recent generated error. The error will either be a three-digit POP3 reply code or a three-digit code in the 900 range generated by Dynamo.

Return

Integer.

Example

This example returns an error if any problems are encountered while disconnecting from the mail server:

<!--SCRIPT 
mlist = new MailList ("mail.sybase.com", "elmo", "secret", "elmo@mail.sybase.com ");
if( !mlist.Disconnect() ) {
document.writeln( mlist.GetErrorCode() );
document.writeln( mlist.GetErrorInfo() );
}

document.WriteLn(mlist);
-->

See also

"mailList object"

"mailPiece object (incoming)"

"mailPiece object (outgoing)"

GetErrorInfo method

Syntax

mailList.GetErrorInfo( )

Description

Returns a string containing an error message. The error can either be a complete reply from the POP3 server or from PowerDynamo.

Return

String.

Example

This example returns an error if any problems are encountered while disconnecting from the mail server

<!--SCRIPT 
mlist = new MailList ("mail.sybase.com", "elmo", "secret", "elmo@mail.sybase.com " );
if( !mlist.Disconnect() ) {
document.writeln( mlist.GetErrorCode() );
document.writeln( mlist.GetErrorInfo() );
}

-->

See also

"mailPiece object (incoming)".

"mailPiece object (outgoing)".

 


Copyright © 1999 Sybase, Inc. All rights reserved.