on 2004 Nov 04 3:28 PM
Hi,
I have maintained some values in the Javamail Client Service in the Visual Administrator. The values are maintained for mail.from and smtp properties.
However i am unable to read to these values from the my webdynpro application. javax.mail.Session.getProvider(String) is not returning any value.
Please provide any suggestions as to how i can read these values. I have trying this for quite some time now without any result.
Thanks and Regards
Sidharth
Hi,
you have to use javax.mail.Session object , bound to naming.
Here is usage example :
<b>Properties props = new Properties();
props.put( "domain", "true" );
Context initialContext = new InitialContext( props );
Session ses = ( Session )initialContext.lookup( "java:comp/env/mail/MailSession" );</b>
Regards
Bojidar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bojidar,
Thanks a lot for the reply. I had been waiting for this solution for quite some time now.
Just one thing i would like to know. How do you get this string value java:comp/env/mail/MailSession and when do we have to decide when we have to use the objects bound to naming. Please do provide some insight into this.
Regards
Sidharth
Hi Sidharth,
this is the standard prefix for binding instantiated javax.mail.Session object, initialized with service properties. If the application needs to use the properties , it should lookup this object.
Anyway you can use Session.getDefaultInstance(Properties) or JavaMail API to set properties runtime.
Regards
Bojidar
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.