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:
- Attachments You can send attachments such as files and documents along
with a mail piece. The attachment object allows the recipients of
the mail piece to manipulate the attachment as required.
- Error checking Use the GetErrorCode and GetErrorInfo methods to monitor
the status of a mail piece.
- Multiple addresses You can send a single mail piece to many people.
- Sender property You can specify a sender property that represents the
person that sent the mail piece. The from property represents the person
from whom the mail piece originated. For example, if an assistant was
sending a mail piece for their supervisor, the assistant's
name would be represented by the sender property while the supervisor's
name would be represented by the from property.
To send a mail piece from Dynamo you need:
- An SMTP host name
- The address of the person you are
sending the mail to
- The address from which the mail piece
is being sent
To create and send a mail piece from within a
Dynamo script:
- Specify an SMTP host in the Default
General Setting folder of Sybase Central.
- Create an empty Dynamo script within
Sybase Central.
- Open the script for editing.
- 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.
- Replace your@address.com with
your own address.
- Replace recipient@address.com
with the address of the recipient.
- Save the script.
- Execute the script.
- 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 the PowerDynamo
Reference Manual.
Copyright © 2001 Sybase, Inc. All rights reserved.
|
|