Hi, The below issue only occurs when trying to attach a file and using encoding="plain".
Your code is not doing any attachments, you should be able to send the mail. Make sure that your SMTP server (450-mail-relay) is running, one way you can check it is through telnet command. # telnet 450-mail-relay 25 I am still not able to figure-out how can I send attachments using encoding="plain" in ANT 1.8 Thanks Rao U. Chaudhri 415-591-3031 -----Original Message----- From: Antoine Levy Lambert [mailto:[email protected]] Sent: Wednesday, March 17, 2010 2:32 PM To: Ant Users List Subject: Re: Issue sending mail with ANT 1.8 when encoding set to "Plain" Hello Rao, I confirm the problem with the following snippet <project name="sendmail"> <mail from="me" mailhost="450-mail-relay" tolist="[email protected]" encoding="plain" subject="Results of nightly build"> </mail> </project> Would you mind entering a bug report in bugzilla ? Regards, Antoine Rao Chaudhri wrote: > Hi, > > > > I am using ANT build files to do build and deploy for J2EE applications. We > recently upgraded ANT from 1.5 to 1.8. > > ANT 1.8 complains while sending e-mail when encoding is set to "Plain", > however, it works fine if encoding is set to "MIME" or "AUTO". > > I want to use encoding "Plain" because this way my log file appears in the > email body, as oppose to MIME or AUTO which attaches the > > file with the body of the email. > > > > Here's my error stack trace when sending e-mail using encoding "Plain" with > ANT 1.8: > > > > [mail] Failed to send email: Socket closed > > > > BUILD FAILED > > > > /1fb/home/build/jdev/scripts/scripts/deploy10gr3/deploybw.xml:415: IO error > sending mail > > at > org.apache.tools.ant.taskdefs.email.PlainMailer.send(PlainMailer.java:113) > > at > org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java:571) > > at > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) > > at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) > > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) > > at org.apache.tools.ant.Task.perform(Task.java:348) > > at org.apache.tools.ant.Target.execute(Target.java:390) > > at org.apache.tools.ant.Target.performTasks(Target.java:411) > > at > org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360) > > at org.apache.tools.ant.Project.executeTarget(Project.java:1329) > > at > org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) > > at org.apache.tools.ant.Project.executeTargets(Project.java:1212) > > at org.apache.tools.ant.Main.runBuild(Main.java:801) > > at org.apache.tools.ant.Main.startAnt(Main.java:218) > > at org.apache.tools.ant.Main.start(Main.java:180) > > at org.apache.tools.ant.Main.main(Main.java:269) > > Caused by: java.net.SocketException: Socket closed > > at java.net.SocketInputStream.socketRead0(Native Method) > > at java.net.SocketInputStream.read(SocketInputStream.java:129) > > at > sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411) > > at > sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453) > > at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183) > > at java.io.InputStreamReader.read(InputStreamReader.java:167) > > at java.io.BufferedReader.fill(BufferedReader.java:136) > > at java.io.BufferedReader.readLine(BufferedReader.java:299) > > at java.io.BufferedReader.readLine(BufferedReader.java:362) > > at > org.apache.tools.mail.SmtpResponseReader.getResponse(SmtpResponseReader.java:58) > > at org.apache.tools.mail.MailMessage.send(MailMessage.java:443) > > at org.apache.tools.mail.MailMessage.sendDot(MailMessage.java:429) > > at > org.apache.tools.mail.MailMessage.sendAndClose(MailMessage.java:348) > > at > org.apache.tools.ant.taskdefs.email.PlainMailer.send(PlainMailer.java:111) > > ... 17 more > > > > > > > > ANT Libraries I am loading in my CLASSPATH: > > > > ant.jar > > ant-launcher.jar > > ant-javamail.jar > > xercesImpl.jar > > activation.jar > > mail.jar > > xml-apis.jar > > > > > > > > Thanks > > Rao U. Chaudhri > > 415-591-3031 > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
