Is there anything special about sending mail with JavaMail when using EJB?
Created May 4, 2012
Tim Rohaly The javax.mail libraries are a standard part of of J2EE, so the whole API is there.
Even the JavaBeans Activation Framework is there, which is required
by JavaMail. However, you're only allowed to send mail, not receive.
With J2EE, you are required to obtain the javax.mail.Session instance from a JNDI lookup rather than creating it yourself, but other than that it's the same as sending mail using JavaMail from a standalone app.
You can look at the Java Pet Store example, which does this.