Ant mail task - a problem when sending mail with attachments

When I tried to use the ant mail task, it does not work when sending mail with attachments arrives. The problem that I am currently facing is sending the contents of the attachments (s) to the body of the message, and not as an attachment, even if the verbose output is displayed, since it is sent with the attachment. Since he initially complained about the missing banks, I added mail.jar and activation.jar. Here is the snippet I tried:

<mail mailhost="mailHost.com" messagemimetype="text/html" subject="Test report" > <from address=" mymaild-addr@somedomain.com "/> <replyto address=" mymaild-addr@somedomain.com "/> <to address=" mymaild-addr@somedomain.com "/> <message> Attached is sample report </message> <attachments> <fileset dir="${myRequiredDirectory}"> <include name="Test.txt"/> <include name="Calls.txt"/> </fileset> </attachments> </mail> 

And I get

 [mail] Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer [mail] Failed to initialise UU mail: Class org.apache.tools.ant.util.ClasspathUtils can not access a member of class org.apache.tools.ant.taskdefs.email.UUMailer with modifiers "" [mail] Sending email: Test report [mail] Sent email with 2 attachments 
+4
source share
1 answer

It worked fine by adding another dependent jar 'ant -javamail.jar.

+4
source

All Articles