geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Boynes <jboy...@apache.org>
Subject Re: using JavaMail
Date Sat, 23 Apr 2005 12:11:09 GMT
Katia Aresti Gonzalez wrote:
> Hi!!
>  
> I just want to know if somebody can help me to use Javamail with Geronimo. what 
> do i need to start?
>  

Add a mail resource with something like:
     <gbean name="mail/MailSession" 
class="org.apache.geronimo.mail.MailGBean">
         <attribute name="properties">
             mail.smtp.host=mail.apache.com
         </attribute>
     </gbean>

(use your mail server and any access properties if it needs them)

You may also need to add a dependency on geronimo-mail

Then in you application you should be able to use this by getting a 
Session from JNDI:

   Session sess = (Session) ctx.lookup("java:comp/env/mail/MailSession");

Once you have the session it should be JavaMail as usual.

--
Jeremy

Mime
View raw message