Posted By:
guru_prasanth
Posted On:
Monday, January 20, 2003 02:32 AM
i am using the following code for my application Properties props = System.getProperties(); // Setup mail server props.put("mail.smtp.host", "dejibook.com"); MyAuthenticator auth = new MyAuthenticator(); props.put("mail.smtp.auth", "true"); // Get session Session session1 = Session.getDefaultInstance(props, auth); // Define message MimeMessage message = new MimeMessage(session1); // Set the from address message.setFrom(new InternetAddress("guruprasanth@dejibook")); // Set the to address message.addRecipient(Message.RecipientType.TO, new InternetAddr
More>>
i am using the following code for my application
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", "dejibook.com");
MyAuthenticator auth = new MyAuthenticator();
props.put("mail.smtp.auth", "true");
// Get session
Session session1 = Session.getDefaultInstance(props, auth);
// Define message
MimeMessage message = new MimeMessage(session1);
// Set the from address
message.setFrom(new InternetAddress("guruprasanth@dejibook"));
// Set the to address
message.addRecipient(Message.RecipientType.TO,
new InternetAddress("guruprasanth@dejibook.com"));
// Set the subject
message.setSubject("important");
// Set the content
message.setText("hello how r u");
// Send message
Transport.send(message);
and it's giving me
java.lang.SecurityException: Access to default session denied
exception.
<<Less