There's a quicker way but I'll go thru the correct steps (one more steps
only):
1. Create a <resource-ref> tag in your component's assembly descriptor
(web.xml, ejb-jar.xml, application-client.xml):
<resource-ref>
<res-ref-name>myMailSession</res-ref-name>
<res-type>javax.mail.Session</res-type>
</resource-ref>
2. Look up the value from within your components code:
Session session = (Session)new
InitialContext().lookup("java:comp/env/myMailSession");
That's it, from there on you just use it as a normal (mail-)Session (if you
want to change the instance it points to
if you've got multiple sessions defined then you edit the
resource-ref-mapping tag in the components deployment file,
orion-*.xml).
/Magnus Stenman, the Orion team
----- Original Message -----
From: "Mistri, Anjana (NOW)" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Tuesday, April 04, 2000 3:06 PM
Subject: Help using mail
> Hi there
>
> Could anyone give me a sample on how to use the Orion mail. I've specified
> the host in server.xml:
> <mail-session location="mail/MailSession" smtp-host="an_ip_address">
> <property name="mail.transport.protocol" value="smtp" />
> <property name="mail.smtp.from" value="[EMAIL PROTECTED]"
> />
> <property name="mail.from" value="[EMAIL PROTECTED]" />
> </mail-session>
>
> Now, how do I actually use it in a bean?
>
> Thanks very much.
>
> Regards,
> Anjana
>
> ---
> Anjana Mistri
> [EMAIL PROTECTED]
>