In our projects, we send message to JMS queue, including mail template and parameters, then MDBs consume the messages in the queue and send the message to the SMTP server through the Mail Session in the WAS.
Noticeably, we shouldn't send mail message to SMTP server directly, as performance might be a potential problem when we do it in a synchronous way.
Further, this function should be encapsulated as a reusable jar.
Did I make myself clear?