Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

how to send mail with Ant

Fri Oct 24, 2008 5:27 pm

<project name="springboardv1" basedir=".">
<property name="src.dir" value="WEB-INF/src" />
<property name="classes.dir" value="WEB-INF/classes" />
<property name="lib.dir" value="WEB-INF/lib" />

<path id="libraries">
<fileset dir="${lib.dir}" includes="*.jar" />
</path>

<target name="sendMail">
<mail subject="Ant Mail" encoding="auto" ssl="false"
mailhost="mySMTP-Host" mailport="my.port" user="my.user"
password="myPwd" messagemimetype="text/plain">
<from address="from.addr"/>
<to address="to.addr"/>
<message>
this is a test mail.
</message>
</mail>
</target>

</project>

Here,
i given all the valid data, which is working fine with Java Mail API.

Error Msg:
sendMail:
[mail] Failed to initialise MIME mail:
javax/mail/MessagingException
BUILD SUCCESSFUL
Total time: 422 milliseconds

I added all the jar files which are needed.

i tried to set some classpath, to <mail> element. but this element wont
have any path or classpath related attributes.

how to resolve this.



Post a reply
  Related Posts  to : how to send mail with Ant
 send mail using php     -  
 send mail cc and bcc in php     -  
 How to send conformation e-mail through JSP     -  
 send mail to Multiple recipients     -  
 validate e-mail in php     -  
 validate mail in jsp     -  
 Help Sending e-mail from VB.Net application     -  
 mail system in java     -  
 php variables in mail function     -  
 mail function problem     -