I have a stand alone program with a main in it. I am ready a table & would like to send emails out to everyone from the table. The method below, gives me the following error. This happens even if the methord is not called.The prgram complies fine, but this is the runtime error I end up getting.
Please help!!.
Exception in
thread "main" java.lang.NoClassDefFoundError: javax/mail/SendFailed
private void sendmessage() throws AddressException, MessagingException{
try{
//Get system properties
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", host);
// Get session
javax.mail.Session mailSession = Session.getDefaultInstance(props, null);
// Define msg
MimeMessage message = new MimeMessage(mailSession);
message.setFrom(new InternetAddress(from));
//create the recipient
try{
addressTo = new InternetAddress(Responsible);
} catch (AddressException ae){
System.out.println("Soemthing went wrong creating the recipient: " + ae.toString());
}//end try-catch creating new InternetAddress
message.setRecipient(Message.RecipientType.TO, addressTo);
message.setSubject(Subject);
// Fill the message
message.setText(Subject);
// Send message
Transport.send(message);
} catch (SendFailedException sfe){
System.out.println("Something went wrong sending the message: " + sfe.toString());
}//end try-catch sending message
} //end sendNotification()