There is an exception when I try to access the JavaMail session:
java.lang.SecurityException: Access to default session denied
at javax.mail.Session.getDefaultInstance(Session.java:321)
the code:
Properties sessionProps = javaMailSession.getProperties();
pipedUsername = sessionProps.getProperty("mail.user");
pipedPassword = sessionProps.getProperty("mail.smtp.password");
Session session = Session.getDefaultInstance(sessionProps,
new Authenticator() {
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(
pipedUsername, pipedPassword);
}
});
any idea ?