I am trying to send email from Ant Script. here is the code snippet
<mail mailhost="smtp.gmail.com" subject="Test Email" user="gmailUser" password="gmailPassword">
<from address="xxxxx@gmail.com" />
<to address="xxxxx@gmail.com" />
<message>Test</message>
</mail>
When I run this script, I am getting an exception
[mail] Failed to initialise MIME mail: javax/mail/MessagingException
Any Ideas?
Note – Ant version in eclipse is 1.7 and I have added following jars to the build path
mail.jar
dsn.jar
imap.jar
mailapi.jar
pop3.jar
smtp.jar
I was able to get this to work by putting the jar files in ant/lib and setting the MIME type as follows: