Java Ant电子邮件错误:需要身份验证
我无法通过ant build发送电子邮件。 我得到以下错误:Java Ant电子邮件错误:需要身份验证,java,email,ant,selenium-webdriver,Java,Email,Ant,Selenium Webdriver,我无法通过ant build发送电子邮件。 我得到以下错误: Buildfile: C:\Users\madhur\workspace\TCLAutomation\build.xml build-subprojects: init: build-project: [echo] Hello Hi in build [echo] TCLAutomation: C:\Users\madhur\workspace\TCLAutomation\build.xml [javac]
Buildfile: C:\Users\madhur\workspace\TCLAutomation\build.xml
build-subprojects:
init:
build-project:
[echo] Hello Hi in build
[echo] TCLAutomation: C:\Users\madhur\workspace\TCLAutomation\build.xml
[javac] C:\Users\madhur\workspace\TCLAutomation\build.xml:32: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
build:
email-testng:
[echo] ---------------------------
[echo] SMTP Server..: smtp.gmail.com
[echo] Subject......: TestNG Report for Date and time 18/December/2012 :(10:56:53)
[echo] Message File.: C:\Users\madhur\workspace\TCLAutomation\test-output\emailable-report.html
[echo] From.........: tcl.testng.reports@gmail.com
[echo] To...........: tcl.testng.reports@gmail.com
[echo] ---------------------------
[mail] Sending email: TestNG Report for Date and time 18/December/2012 :(10:56:53)
[mail] Failed to send email: 530-5.5.1 Authentication Required. Learn more at
[mail] 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 o11sm493273pby.8
BUILD FAILED
C:\Users\madhur\workspace\TCLAutomation\build.xml:132: Problem while sending mime mail:
Total time: 2 seconds
构建脚本
<target description="Email the testng style format report." name="email-testng" >
<property name="report.type" value="TestNG" />
<tstamp>
<format property="HUMANDATE" pattern="dd/MMMM/yyyy :(HH:mm:ss)" />
</tstamp>
<property name="subject" value="${report.type} Report for Date and time ${HUMANDATE}" />
<echo>---------------------------</echo>
<echo>SMTP Server..: smtp.gmail.com</echo>
<echo>Subject......: ${subject}</echo>
<echo>Message File.: ${basedir}\test-output\emailable-report.html</echo>
<echo>From.........: tcl.testng.reports@gmail.com</echo>
<echo>To...........: tcl.testng.reports@gmail.com</echo>
<echo>---------------------------</echo>
<zip destfile="${basedir}/PictorialReports.zip" basedir="${basedir}/testng-xslt" update="true"/>
<zip destfile="${basedir}/FailedCasesScreenShots.zip" basedir="${basedir}/ScreenShots" update="true"/>
<mail mailhost="smtp.gmail.com" mailport="465" password="xxxxxxx" ssl="true" subject="${subject}" user="tcl.testng.reports@gmail.com">
<from address="tcl.testng.reports@gmail.com"></from>
<replyto address="tcl.testng.reports@gmail.com"></replyto>
<to address="tcl.testng.reports@gmail.com"></to>
<message>This is auto generated mail after completion of test case execution.The Reports of test cases executed.Download the attachments and keep all attachemnts in same folder.Double click on emailable-reports.html for results of executed test cases. Double click on index.html to view them in pie chart model.
</message>
<attachments>
<fileset dir="${basedir}/test-output">
<include name="emailable-report.html"></include>
</fileset>
<fileset dir="${basedir}">
<include name="PictorialReports.zip"></include>
</fileset>
<fileset dir="${basedir}">
<include name="FailedCasesScreenShots.zip"></include>
</fileset>
</attachments>
</mail>
</target>
他们提供的链接没有帮助。我无法获得所需的身份验证问题。
有人能帮忙吗。
谢谢。您的用户名/密码正确吗?是的,正确。我从web登录,它正在工作。请包含构建脚本的相关部分以获得更好的帮助。可能是您发送的帐户有问题。所示的构建脚本对我的SAN附件运行良好。我刚刚检查了它是否在另一台机器上运行。我的机器可能有什么问题?