Send an email message asynchronously.
Syntax
void sendEmail(String message, String subject, Vector recipients)
Parameters
- message
- The text of the email message.
- subject
- The subject line of the email message
- recipients
- A Vector that contains email addresses of the message
recipients. This vector contains String objects.
Notes
The sendEmail() method can send an
email message to the recipients specified in the
recipients vector if:
- An email address has been specified in the Email notification
address field in the Collaboration Object Properties dialog.
- The Email collaboration and Email adapter are running. (The Email
collaboration is instantiated and configured automatically when InterChange
Server starts up and does not require input from the user.) If the
Email adapter is not running, sendEmail() does not cause
execution of the collaboration to halt.
- Note:
- The logError() method automatically sends an error message to an
email recipient (assuming that the Email collaboration and adapter are
running). The sendEmail() method allows you to explicitly
send an email message.
Examples
// Initialize the Vector for the list of email addresses
Vector emailList = new Vector();
// Add as many email addresses as Strings to the Vector
emailList.add("dbadmin@us.ibm.com");
emailList.add("netadmin@us.ibm.com");
emailList.add("cwadmin@us.ibm.com");
// Initialize the message and subject as Strings
String message = "This is the body of the email";
String subject = "This is the subject of the email";
// Make the call to sendEmail()
sendEmail(message, subject, emailList);
