ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barry White <bwh...@fotango.com>
Subject Re: Problem about send mail
Date Wed, 24 Aug 2005 07:30:08 GMT
Your build assumes that smtp.gmail.com is waiting for insecure 
connections on the standard smtp port. As far as I know, for 
smtp.gmail.com, you need to use port 587 with TLS enabled. Looking at 
the docs you will need JavaMail in you classpath too. Try:

<mail mailhost="smtp.gmail.com" mailport="587" ssl="true"....

Barry

Guo Rui wrote:
> hi all:
>    I want to send a mail use ant,so I write a task like below:
>   <target name="mail">
> <mail mailhost="smtp.gmail.com" mailport="25" subject="Test build"
> user="myusername" password="mypassword">
>   <from address="rayguo@gmail.com"/>
>   <to address="rayguo@gmail.com"/>
>   <message>The nightly build has completed</message>
> </mail>
>   </target>
>   But when I run "ant mail",it report "IO error sending mail", so I
> run "ant -verbose",it report :
> C:\>ant -verbose
> Apache Ant version 1.6.2 compiled on July 16 2004
> Buildfile: build.xml
> Detected Java version: 1.4 in: C:\Program Files\Java\j2re1.4.2_09
> Detected OS: Windows XP
> parsing buildfile C:\build.xml with URI = file:///C:/buil
> .xml
> Project base dir set to: C:\
> Build sequence for target `mail' is [mail]
> Complete build sequence is [mail, ]
> 
> mail:
>      [mail] Failed to initialise MIME mail: javax/activation/DataSource
>      [mail] Using UU mail
>      [mail] Sending email: Test build
>      [mail] From rayguo@gmail.com
>      [mail] ReplyTo []
>      [mail] To [rayguo@gmail.com]
>      [mail] Cc []
>      [mail] Bcc []
>      [mail] Failed to send email
> 
> BUILD FAILED
> C:\build.xml:3: IO error sending mail
>         at org.apache.tools.ant.taskdefs.email.PlainMailer.send(PlainMailer.jav
> :91)
>         at org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java
> 548)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
>         at org.apache.tools.ant.Main.runBuild(Main.java:673)
>         at org.apache.tools.ant.Main.startAnt(Main.java:188)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
> Caused by: java.io.IOException: Didn't get introduction from server:
>         at org.apache.tools.mail.MailMessage.getReady(MailMessage.java:403)
>         at org.apache.tools.mail.MailMessage.connect(MailMessage.java:396)
>         at org.apache.tools.mail.MailMessage.<init>(MailMessage.java:174)
>         at org.apache.tools.ant.taskdefs.email.PlainMailer.send(PlainMailer.jav
> :41)
>         ... 11 more
> --- Nested Exception ---
> java.io.IOException: Didn't get introduction from server:
>         at org.apache.tools.mail.MailMessage.getReady(MailMessage.java:403)
>         at org.apache.tools.mail.MailMessage.connect(MailMessage.java:396)
>         at org.apache.tools.mail.MailMessage.<init>(MailMessage.java:174)
>         at org.apache.tools.ant.taskdefs.email.PlainMailer.send(PlainMailer.jav
> :41)
>         at org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java
> 548)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
>         at org.apache.tools.ant.Main.runBuild(Main.java:673)
>         at org.apache.tools.ant.Main.startAnt(Main.java:188)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
> 
> Total time: 1 second
> 
> Who can tell me how to use this task? Thank you in advance.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

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


Mime
View raw message