Skip to Content

Javamail Client Service

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Nov 08, 2004 at 01:49 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Sidharth Deshpande

      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