Q: I'm trying to get a coverage report mailed to the team as shown in your example, but I keep getting "[mail] Failed to send email". How do I fix this?
The Ant <mail>
task depends on external libraries that are not included in the Ant distribution. You need to install the following jars in ANT_HOME/lib, both freely available from Sun:
mail.jar
— from the JavaMail API ([http://java.sun.com/products/javamail/)activation.jar
— from the JavaBeans Activation Framework (http://java.sun.com/products/javabeans/jaf/index.jsp)You should also check the details of your local SMTP server with your system administrator. It may help to specify these details directly to the <mail>
task:
<mail mailhost="smtp.myisp.com" mailport="25" from="build@example.com" tolist="team@example.com" subject="coverage criteria not met" message="$ {coverageFailed} " files="coverage_summary.pdf"/>