ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kew, Whitney CLE 2645" <W...@RainBird.com>
Subject MIME/connection errors with MailLogger and <mail>
Date Tue, 02 Dec 2003 22:26:58 GMT
Hi there,

I'm somewhat of an Ant newbie.  I'm trying to get an email sent once a build
occurs on my machine, which is running Win2K SP4.  I'm using Ant 1.5.4.

The first thing I tried was the <mail> task, but I received the following
errors:

   make_test1:
        [mail] Failed to initialise MIME mail
        [mail] Sending email: Test build
        [mail] Failed to send email
   
   BUILD FAILED
   file: build.xml:28: IO error sending mail

The relevant .XML code that resulted in these errors is as follows:

   <target name="make_test1"
           depends="init">
      <property name="PROJECT" value="test1"/>
      <property name="LOGFILE" value="${PROJECT}.log"/>
      <property name="MYEMAIL" value="wkew@rainbird.com"/>
      <exec executable="${VSNET_EXE}" failonerror="true">
         <arg line="/REBUILD RELEASE /OUT ${LOGFILE} ${PROJECT}.sln"/>
      </exec>
      <mail mailhost="the_mail_server"
            subject="Test build">
         <from address="${MYEMAIL}"/>
         <to address="${MYEMAIL}"/>
         <message>The build completed.</message>
      </mail>
   </target>

Then, I tried using the MailLogger, but then I got a Java ConnectException:

MailLogger failed to send e-mail!
java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at org.apache.tools.mail.MailMessage.connect(MailMessage.java:375)
        at org.apache.tools.mail.MailMessage.<init>(MailMessage.java:197)
        at org.apache.tools.mail.MailMessage.<init>(MailMessage.java:179)
        at
org.apache.tools.ant.listener.MailLogger.sendMail(MailLogger.java:220)
        at
org.apache.tools.ant.listener.MailLogger.buildFinished(MailLogger.java:161)
        at org.apache.tools.ant.Project.fireBuildFinished(Project.java:1913)
        at org.apache.tools.ant.Main.runBuild(Main.java:628)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

The relevant portion of my .XML file looks like this:

<target name="make_test1"
        depends="init">
   <property name="PROJECT" value="test1"/>
   <property name="LOGFILE" value="${PROJECT}.log"/>
   <property name="MYEMAIL" value="wkew@rainbird.com"/>
   <property name="MailLogger.mailhost" value="the_mail_server"/>
   <property name="MailLogger.from" value="${MYEMAIL}"/>
   <property name="MailLogger.success.to" value="${MYEMAIL}"/>
   <property name="MailLogger.failure.to" value="${MYEMAIL}"/>
   <exec executable="${VSNET_EXE}" failonerror="true">
      <arg line="/REBUILD RELEASE /OUT ${LOGFILE} ${PROJECT}.sln"/>
   </exec>
</target>

Essentially, I'm trying to determine if I'm doing something wrong in Ant, or
if our company's mail server simply isn't playing nicely with me.  Does
anyone have any suggestions?

Thanks very much!

Whitney Kew
Software Engineer
Rain Bird Corporation
wkew@rainbird.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message