JavaMail
I am trying to make a jar file that has class files for an email program. I have created the GUI for this already and I am using the code below to send the email. The program runs fine when I execute the main class. The problem comes up when I try to execute the .jar file. The error I receive is:
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: IOException while sending message;
nested exception is:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type text/plain; charset=us-ascii
Does anyone know how to run the email program in a .jar file? Thanks for the help.
Properties props = System.getProperties();
props.put("mail.smtp.host", host);
Session session = Session.getDefaultInstance(props, null);
// Define message
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipients(Message.RecipientType.TO, to);
message.setSubject(subject);
// Fill the message
message.setText(body);
// Send the message
Transport.send(message);

