gpt4 book ai didi

java - apacheant 邮件任务和 STARTTLS

转载 作者:行者123 更新时间:2023-12-02 07:34:47 26 4
gpt4 key购买 nike

每次有人运行 apacheant 来更新我们的实时服务器时,我都会尝试向我的团队发送电子邮件,我尝试通过 GMAIL 发送电子邮件,但是当我运行 ant upload_live -d 时,我收到以下错误,

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

sending mime mail: at org.apache.tools.ant.taskdefs.email.MimeMailer.send(MimeMailer.java:241) at org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java:577) 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: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.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. 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="apache.ant.alert@gmail.com" password="*********" subject="${project} Pushed Live">
<from address="apache.ant.alert@gmail.com"/>
<replyto address="apache.ant.alert@gmail.com"/>
<to address="simon@"/>
<cc address="andrew@" />
<message>${project} has successfully been transferred via FTP.</message>
</mail>
<echo>Mail Sent</echo>

我做错了什么?

最佳答案

我用以下内容进行了排序,

<mail enableStartTLS="true" ssl="true" mailhost="smtp.gmail.com" mailport="465" user="apache.ant.alert@gmail.com" password="******" subject="${project} Pushed Live">
<from address="apache.ant.alert@gmail.com"/>
<replyto address="apache.ant.alert@gmail.com"/>
<to address="simon@"/>
<cc address="andrew@" />
<message>${project} has successfully been transferred via FTP.</message>
</mail>

关于java - apacheant 邮件任务和 STARTTLS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12408340/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com