Home Getting an exception Rejecting re-init on previously-failed class java.lang.Class while trying to send the email using GMAIL API
Reply: 0

Getting an exception Rejecting re-init on previously-failed class java.lang.Class while trying to send the email using GMAIL API

user1296
1#
user1296 Published in April 23, 2018, 9:21 am

Written in Async task - on background

public MimeMessage createEmail(String to, String from, String subject, String bodyText) throws MessagingException {
        Properties props = new Properties();
        Session session = Session.getDefaultInstance(props, null);

        MimeMessage email = new MimeMessage(session);

        email.setFrom(new InternetAddress(from));
        email.addRecipient(javax.mail.Message.RecipientType.TO,
                new InternetAddress(to));
        email.setSubject(subject);
        email.setText(bodyText);
        return email;
    }

Error: Getting error like this when I tried to call create email method in the async background. Rejecting re-init on previously-failed class

java.lang.Class Caused by: java.lang.NoClassDefFoundError: javax.activation.DataHandler at javax.mail.internet.MimeMessage.setContent(MimeMessage.java:1516) at javax.mail.internet.MimeBodyPart.setText(MimeBodyPart.java:1176) at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1555) at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1539)

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.332699 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO