send an mail using ANT

Posted by shilpi.agarwal3373 on 02-Jun-2016 04:51

Hi team,

I want to send an mail through ANT. For this, I have copied mail.jar and activation.jar in ANT-Installation-Dir/lib folder and also basedir/lib folder. I have downloaded javamail-1_3_3_01.zip (which contains mail.jar), jaf-1_0_2-upd2.zip (which contains activation.jar), and copying the two jar files into the lib directory of Apache Ant. 

But I am  getting following error.

Failed to send email: javax.mail.internet.MimeMessage

BUILD FAILED
C:\shilpi\POC\ablunit\build.xml:57: java.lang.ClassNotFoundException: javax.mail.internet.MimeMessage

below is my ANT mail task.

<target name="all" description="send email using ant" >
<mail mailhost="secure.emailsrvr.com" mailport="465" user ="test@jktech.com" password=test" ssl="true" subject="Test build">
<from address="test@jktech.com"/>
<to address="testto@jktech.com"/>
<message>The test has completed</message>
</mail>
</target>

Please suggest if I am missing something.

All Replies

Posted by shilpi.agarwal3373 on 03-Jun-2016 00:42

Please help me out for above problem

Posted by Mike Fechner on 03-Jun-2016 00:48

Since the issues is not OpenEdge related at all, google may be your friend. This was my first hit on your error message:

stackoverflow.com/.../build-xml-is-failing-to-send-email-gives-java-lang-classnotfoundexception-jav

Posted by shilpi.agarwal3373 on 03-Jun-2016 01:27

Ok Mike. Really appreciate.

This thread is closed