2012-09-13 83 views
0

我想每次有人運行apacheant更新我們的實時服務器時發送一封電子郵件到我的團隊,但我試圖通過GMAIL發送郵件,但是當我運行時,ant upload_live -d我收到以下錯誤,apacheant郵件任務和STARTTLS

BUILD FAILED /Users/simon/Documents/websites/apacheant/build.xml:116: Problem while 

發送郵件默: 在org.apache.tools.ant.taskdefs.email.MimeMailer.send(MimeMailer.java:241) 在org.apache.tools。 ant.taskdefs.email.EmailTask​​.execute(EmailTask​​.java:577) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.Gene評分方法訪問4.invoke(未知源) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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:1399) at org.apache.tools .ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:809) at org.apache.tools.ant.Main。在org.apache.tools.ant.launch.Launcher.main(Launcher.java: 109)引起 作者:com.sun.mail.smtp.SMTPSendFailedException:530 5.7.0必須首先發出一個 STARTTLS命令。 dp8sm20701038wib.3

at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388) 
    at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959) 
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583) 
    at javax.mail.Transport.send0(Transport.java:169) 
    at javax.mail.Transport.send(Transport.java:98) 
    at org.apache.tools.ant.taskdefs.email.MimeMailer.send(MimeMailer.java:239) 
    ... 17 more 

我的目標定義是這樣的,

<mail enableStartTLS="true" ssl="no" mailhost="smtp.gmail.com" mailport="587" user="[email protected]" password="*********" subject="${project} Pushed Live"> 
     <from address="[email protected]"/> 
     <replyto address="[email protected]"/> 
     <to address="[email protected]"/> 
     <cc address="[email protected]" /> 
     <message>${project} has successfully been transferred via FTP.</message> 
    </mail> 
    <echo>Mail Sent</echo> 

我在做什麼錯?

回答