Using Java code within Katalon file getting "Groovy:unable to resolve class"

Hey,

I’m trying to use JavaMail in my code and - although having working code that reads email (IMPA), for some reason now when attempting to instantiate a MimeMessage I’m getting the following compilation err mgs: “Groovy:unable to resolve classs MimeMessage”
I know it’s supposed to be working as it’s based on code snippets supplied in various trusted websites (e.g. oracle java) but for some reason it’s not working for me.
In general, I’m not sure I know when I can add Java code to Katalon file cause it doesn’t seem to be consistent (need to say that I don’t really have Groovy experience - can some code I’m using be BOTH Java AND Groovy, and that’s why it seems to me to be Java although it’s also valid Groovy?)

If you know of reliable resources for JavaMail samples, ones you or anyone have used successfully - I’d appreciate links.
Thanks guys.

You got “Groovy: unable to resolve class MimeMessage” because the
javax.mail.internet.MimeMessage class is not bundled in Katalon Studio.

The javax.mail.internet.MimeMessage class is included in the javaee.jar file.
Downloading JavaEE SDK from https://www.oracle.com/technetwork/java/javaee/downloads/index.html and install it. Find javaee.jar in the sdk/lib directory.

And you add javaee.jar into Katalon Studio following the procedure at https://docs.katalon.com/display/KD/External+Libraries