In your junit tag you at least need these attributes: haltonfailure="false" haltonerror="false".
This is the portion of script to call junit and see if it is failed and then send email:
<target name="junittest">
...
<junit haltonfailure="false" haltonerror="false"
errorproperty="test.error" failureproperty="test.error"
....
</junit>
<!--behaves conditionally-->
<antcall target="sendMail"/>
</target>
<target name="sendMail" if="test.error">
<mail mailhost="${mailhost}"
mailport="${mailport}"
failonerror="false"
from="me-AT-me-DOT-com"
tolist="${mailAddresses}"
subject="${subject}"
files="${file}"/>
</target>