About the Mail Component API

The Mail component provides an API for programmatically configuring the Mail component using a Java program.

For more information about component APIs, see Component APIs.

The Mail component API consists of the following methods:

  • get/set("from"). This method allows you to get/set the address of the e-mail account from which this e-mail should be sent. If left undefined, an attempt will be made to set this value from your Isight preferences.

  • get/set("to"). This method allows you to get/set the recipients as a string of comma-separated e-mail addresses.

  • add("to"). This method adds the specified e-mail address as a recipient of this e-mail. To add a recipient with a delivery mode of cc or bcc, use the add("recipient", String address, int recipientType) method.

  • get/set("subject"). This method allows you to get/set the subject to use for the e-mail.

  • get/set("messagebody"). This method allows you to get/set the body of the mail message. To insert parameters, use the set ("messagebody", String[] messages, String[] messageTypes) signature.

  • get("messagetypes"). This method returns the associated types ("text" or "parameter") for each string in the array representing the body of the message. For the corresponding messages, use get("messages"). For a correctly formatted body, use get("messagebody").

  • get/set("mailserver"). This method allows you to get/set the mail server to use. If none is set, Isight attempts to use a mail server specified in your Isight preferences (e.g., mailhost.companyname.com).

  • add("recipient", String address, int recipientType). This method adds the specified e-mail address as a recipient of this e-mail with the specified delivery mode (0 ="to", 1 = "cc", 2 = "bcc").

  • add("attachment", File file). This method adds a file on a disk as an attachment to the mail. Isight creates a file parameter for the specified file and adds it to the component.

  • add("attachment", DtScalarVariable fileParameter). This method adds an existing file parameter as an attachment to the e-mail. You must add the file parameter to the component separate from this call.

  • call("send"). This method sends the e-mail using the current settings/configuration.