Chapter 9 PowerDynamo Mail Support


Sending mail

To send mail with PowerDynamo use the outgoing mail piece object. The outgoing mail piece object has many different methods and properties to help manipulate the way you want your outgoing mail piece to perform.

Some of the options that may be useful when sending mail through PowerDynamo are as follows:

To send a mail piece

To send a mail piece from Dynamo you need:

Steps To create and send a mail piece from within a Dynamo script:

  1. Specify an SMTP host in the Default General Setting folder of Sybase Central.

  2. Create an empty Dynamo script within Sybase Central.

  3. Open the script for editing.

  4. Enter:

    <!--SCRIPT
    mp = new MailPiece();
    mp.from = "your@address.com";
    mp.AddRecipient( "recipient@address.com" );
    mp.subject = "My first mail piece";
    mp.body = "This mail piece was sent from a Dynamo script.";
    mp.Send();
    -->


    This code creates a mail piece called mp. Properties and methods are used to define the sender, recipient, subject, and actual content of the mail piece. The Send method actually sends the mail piece.

  5. Replace your@address.com with your own address.

  6. Replace recipient@address.com with the address of the recipient.

  7. Save the script.

  8. Execute the script.

  9. To verify that the mail piece was sent, replace the line:

        mp.Send();


    with:

    if( !mp.Send() ) {
    document.writeln( mp.GetErrorCode() );
    document.writeln( mp.GetErrorInfo() );
    }



For additional information, see "The mail piece object (outgoing)" in PowerDynamo Reference.

 


Copyright © 1999 Sybase, Inc. All rights reserved.