Java Mail

java

https://github.com/ram-sharma-6453/email-mime-parser
https://stackoverflow.com/questions/3444660/java-email-message-parser
https://gusto77.wordpress.com/2012/04/03/extracting-text-from-email-message-with-javamail/
https://docs.oracle.com/cd/E19957-01/816-6028-10/asd3j.htm
http://wrongnotes.blogspot.com/2007/09/javamail-parsing-made-easy.html
http://techforum4u.com/content.php/177-HOW-TO-PARSE-AN-EMAIL-USING-THE-JAVAMAIL-API
https://stackoverflow.com/questions/26348674/parse-mime-body-using-java-mail-mimemessage

https://www.tutorialspoint.com/javamail_api/javamail_api_environment_setup.htm
http://www.programcreek.com/java-api-examples/javax.mail.internet.MimeMessage

What do we need to do if we face the "addBodyPart is undefined for type Multipart" problem?

Your program may be failing with "Uncompiled" errors, and when you check your Eclipse, you see the "addBodyPart is undefined for type Multipart" error. When this happened to me, I do the following:

  1. Go to Java Build Path
  2. Click on the Order and Export tab
  3. Select activation.jar and move it to the top
  4. Select mail.jar and move it right below activation.jar

Inside the javac command (in the build.xml file), I also specified the activation.jar and mail.jar:

<javac optimize="no" debug="yes" srcdir="${src}" destdir="${build}">
    <classpath>
        <pathelement location="helperjars/activation.jar"/>
        <pathelement location="helperjars/mail.jar"/>
        <fileset dir="helperjars/" casesensitive="no">
            <include name="**/*.jar"/>
            <include name="**/*.zip"/>
            <exclude name="activation.jar"/>
            <exclude name="mail.jar"/>
        </fileset>
    </classpath>
</javac>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License