I'm trying to get a coverage report mailed, but I keep getting "mail  Failed to send email". How do I fix this?

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:

  1. mail.jar — from the JavaMail API ([http://java.sun.com/products/javamail/)
  2. 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"/>


Last modified on Aug 17, 2007

Was this helpful?

Yes
No
Provide feedback about this article

Not finding the help you need?

Ask the community

Powered by Confluence and Scroll Viewport.