Marcel
Marcel

Reputation: 4402

Sending a mail in groovy (without additional libs)

I'm writing several scripts which are shared within the company. I currently have the requirement that under some conditions a mail should be sent.

This is pretty easy by using the javax.mail.* packages which are unfortunately not part of the default library.

The scripts are shared via VCS and mostly used by business people who open them via double click. (groovy files are on their systems automatically opened with grooovy.bat)

It would be a huge effort the install the libs on all their systems. Everywhere Groovy 2.4.5 and Java 8 is configured.

Is there an easier way of sending a mail? For example by

thanks in advance

Upvotes: 1

Views: 307

Answers (1)

rdmueller
rdmueller

Reputation: 11042

You can fetch libraries dynamically with the @Grab statement, but you have to ensure that your script will be able to load the lib from a repository.

http://www.groovy-lang.org/Grape

Upvotes: 2

Related Questions