Chapter 9 PowerDynamo Mail Support


Receiving mail

You can receive mail through Dynamo using a POP3 server, the DynaScript mail list, and incoming mail piece objects.

To retrieve mail from PowerDynamo

To retrieve mail from PowerDynamo you need:

The most efficient way to retrieve mail is to generate a list of the mail pieces that are waiting at the POP3 server, then select the mail pieces you want to download. Generally this will be done all in one script.

Steps To generate and retrieve a mail list from a Dynamo script

  1. Create an empty Dynamo script within Sybase Central.

  2. Open the script for editing.

  3. Enter this code, which creates a mail list object and a connection to the POP3 mail server. Replace mail.sybase.com with the name of your POP3 server:

    <!--SCRIPT 
    mlist = new MailList ("mail.sybase.com", "elmo", "secret", "elmo@mail.sybase.com");
    document.WriteLn(mlist);
    -->


  4. You may request all your mail or you may select individual pieces of mail based on size or subject matter.

    To retrieve all your mail from a Dynamo mail list, modify the code so that it looks like this:

    <!--SCRIPT 
    mlist = new MailList ("mail.sybase.com", "elmo", "secret", "elmo@mail.sybase.com");
    num = mlist.count
    document.WriteLn("There are " + num + " messages in the mail box");
    for (i in mlist) {
    inPiece=mlist[i];
    if (inPiece.subject == "Bug Report") {
    inPiece.Retrieve();
    document.WriteLn( "body: " + inPiece.body );
    document.WriteLn( "sender: " + inPiece.sender );
    }
    }
    mlist.Disconnect();
    -->


    This script checks each mail piece to see if the subject line is "Bug Report." If it is, the contents of the mail piece and the sender display.

  5. Save the script.

  6. Execute the script.


 


Copyright © 1999 Sybase, Inc. All rights reserved.