Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

16.3. Configuration

To include Email support in your application, include jboss-seam-mail.jar in your WEB-INF/lib directory. If you are using JBoss AS there is no further configuration needed to use Seam's email support. Otherwise you need to make sure you have the JavaMail API, an implementation of the JavaMail API present (the API and impl used in JBoss AS are distributed with seam as lib/mail.jar), and a copy of the Java Activation Framework (distributed with seam as lib/activation.jar.
The Seam Email module requires the use of Facelets as the view technology. Future versions of the library may also support the use of JSP. Additionally, it requires the use of the seam-ui package.
The mailSession component uses JavaMail to talk to a 'real' SMTP server.

16.3.1. mailSession

A JavaMail Session may be available via a JNDI lookup if you are working in an JEE environment or you can use a Seam configured Session.
The mailSession component's properties are described in more detail in Section 23.8, “Mail-related components”.

16.3.1.1. JNDI lookup in JBoss AS

The JBossAS deploy/mail-service.xml configures a JavaMail session binding into JNDI. The default service configuration will need altering for your network. https://wiki.jboss.org/wiki/Wiki.jsp?page=JavaMail describes the service in more detail.
<components xmlns="https://jboss.com/products/seam/components"
        xmlns:core="https://jboss.com/products/seam/core"
        xmlns:mail="https://jboss.com/products/seam/mail">
        
    <mail:mail-session session-jndi-name="java:/Mail"/>
    
</components>
Here we tell Seam to get the mail session bound to java:/Mail from JNDI.

16.3.1.2. Seam configured Session

A mail session can be configured via components.xml. Here we tell Seam to use smtp.example.com as the smtp server,
<components xmlns="https://jboss.com/products/seam/components"
        xmlns:core="https://jboss.com/products/seam/core"
        xmlns:mail="https://jboss.com/products/seam/mail">
        
    <mail:mail-session host="smtp.example.com"/>
    
</components>

 
 
  Published under the terms of the Open Publication License Design by Interspire