users@glassfish.java.net

Re: JavaMail session (Additional Properties??)

From: Felipe Gaúcho <fgaucho_at_gmail.com>
Date: Thu, 29 Jan 2009 22:49:39 +0100

SOLVED !

Glassfish implementation uses dash (-) instead of a dot (.) in the
properties of the JavaMail Sessions:


From here: http://docs.sun.com/app/docs/doc/819-3672/beaow?a=view
JavaMail Session Properties: You can set properties for a JavaMail
Session object. Every property name must start with a mail- prefix.
The Application Server changes the dash (-) character to a period (.)
in the name of the property and saves the property to the
MailConfiguration and JavaMail Session objects. If the name of the
property doesn't start with mail-, the property is ignored.

For example, if you want to define the property mail.from in a
JavaMail Session object, first define the property as follows:

    * Name – mail-from
    * Value – john.doe_at_sun.com



This microscopical detail killed few hours of my life, but the good
news is that IT WORKS :)

my message driven beans are sending emails now, using JavaMail session
injected by Glassfish.. it is really beautiful...

and if there is someone that can explain me why the hell you guys
changed the eternal known dot by a dash in Glassfish implementation,
please it is a good moment to talk.. :) eheh

as soon I clean the mess here I plan to blog about this adventure with
Glassfish + GMail + MOM :)



On Thu, Jan 29, 2009 at 10:15 PM, Felipe Gaúcho <fgaucho_at_gmail.com> wrote:
> after debugging my javamail sessions, I figured out the additional
> properties are not included in my Session.props object ....... :((
>
> why ??
>
> should I configure something else ?
>
> * if I get the properties in the code and add manually the missed
> properties, it send emails normally...
>