friends i am having this error Help me to rectify it.
am using all jar files correctly
java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger
<%
String emailid = "xxxxxxxx";
String key = "bfskjbfskjdbnf";
String host = "smtp.gmail.com";
final String from = "xxxxxxx";
final String psd = "xxxxxxx";
String sub = "Sending Password";
String body = "Thank you for Register"
+ " Userid = "+emailid +" and Password = "+key;
// Properties props = System.getProperties();
Properties props= new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
Session mailSession = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(from, psd);
}
});
mailSession.setDebug(true);
Message msg = new MimeMessage(mailSession);
//Message msg = new MimeMessage(mailSession);
try{
msg.setFrom(new InternetAddress(from));
InternetAddress add[] = {new InternetAddress(emailid)};
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(emailid));
msg.setSubject(sub);
msg.setText(body);
Transport.send(msg);
System.out.println("send success!");
}
catch(MessagingException ex)
{
ex.printStackTrace();
}
//Transport trans = session.getTransport("smtp");
//Transport.send(msg);
//Transport.send(msg);
//ending sending mail code
%>
am using all jar files correctly
java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger
<%
String emailid = "xxxxxxxx";
String key = "bfskjbfskjdbnf";
String host = "smtp.gmail.com";
final String from = "xxxxxxx";
final String psd = "xxxxxxx";
String sub = "Sending Password";
String body = "Thank you for Register"
+ " Userid = "+emailid +" and Password = "+key;
// Properties props = System.getProperties();
Properties props= new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
Session mailSession = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(from, psd);
}
});
mailSession.setDebug(true);
Message msg = new MimeMessage(mailSession);
//Message msg = new MimeMessage(mailSession);
try{
msg.setFrom(new InternetAddress(from));
InternetAddress add[] = {new InternetAddress(emailid)};
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(emailid));
msg.setSubject(sub);
msg.setText(body);
Transport.send(msg);
System.out.println("send success!");
}
catch(MessagingException ex)
{
ex.printStackTrace();
}
//Transport trans = session.getTransport("smtp");
//Transport.send(msg);
//Transport.send(msg);
//ending sending mail code
%>