Specify Mail Resource Dialog Box

See Also

You use this dialog box to automatically generate code that sends an e-mail from a Java file. You open the dialog box by right-clicking a Java file in the Source Editor and choosing Insert Code > Send E-mail. The file must be in an EJB module project or a standard web application project. You cannot generate e-mail code in a free-form web application project.

You use the dialog box as follows:

  1. Specify the JNDI name of the resource.
  2. Under Service Locator Strategy, specify whether to generate inline lookup code or use an existing service locator. You can click Browse to search for the service locator class name.
  3. Click OK.

    The IDE creates two methods:

    The IDE also registers the resource reference in your module's general deployment descriptor.

  4. In your code, call the sendMail method and pass the e-mail address, subject, and body as parameters.
See Also
Using a Service Locator

Legal Notices