An EmailEvent can be defined with the various properties that you expect for a piece of e-mail: From, Recipient, Subject, and Body. You can also set additional headers to be sent in the mail, and specify a list of recipients as opposed to a single recipient.

For example:

EmailEvent em = new EmailEvent ();
em.setFrom ("dynamotester");
em.setRecipient ("");
em.setSubject ("I'm just testing the e-mail sender");
em.setBody ("Sorry to bother you, but I'm testing the e-mail sender");

The EmailEvent also includes a number of constructors that simplify the construction of typical e-mail events:

EmailEvent em =
  new EmailEvent ("dynamotester",
                  "I'm just testing the e-mail sender"
                  "Sorry to bother you, but I'm testing the e-mail sender");

You can also set a list of recipients:

String [] recipients = {
em.setRecipientList (recipients);

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices