when im trying to send a mail using java mail api in my web application , I\'m getting this exception.
java.lang.SecurityException: Access to default session denied
This error text is associated with a call to Session.getDefaultInstance(props, authenticator)
where the default instance already has a different authenticator set.
It should work better if you call Session.getInstance(props, authenticator)
instead of Session.getDefaultInstance(props, authenticator)
in your code.