Is anythis wrong here help me
<%@ page import="java.security.Security,java.util.Properties,javax.mail.Message,javax.mail.PasswordAuthentication;
import javax.mail.Session,javax.mail.Transport,javax.mail.internet.InternetAddress,javax.mail.internet.MimeMessage" %>
<%try{
String subject =request.getParameter("subject");
String body =request.getParameter("body");
String sender=request.getParameter("to");
String recipients=request.getParameter("from");
String mailhost = "smtp.gmail.com";
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
Properties props = new Properties();
props.setProperty("mail.transport.protocol", "smtp");
props.setProperty("mail.host", mailhost);
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.fallback", "false");
props.setProperty("mail.smtp.quitwait", "false");
Session sessions = Session.getDefaultInstance(props,
new javax.mail.Authenticator()
{
protected PasswordAuthentication getPasswordAuthentication()
{ return new PasswordAuthentication("vanumasrikanth","******"); }
});
javax.mail.internet.MimeMessage message = new MimeMessage(sessions);
message.setSender(new InternetAddress(sender));
message.setSubject(subject);
message.setContent(body, "text/plain");
if (recipients.indexOf(',') > 0)
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients));
else
message.setRecipient(Message.RecipientType.TO, new InternetAddress(recipients));
Transport.send(message);
out.print("mail sent");
}
catch (Exception e) {out.print(e);
}
%>
and the error is
java.lang.SecurityException: Access to default session denied
help me