I am using following plugin in POM.xml file for sending reports on email after completion of test execution. But getting following issue - SMTP: got response code 530, with response:
530 5.7.57 SMTP; Client was not authenticated to send anonymous mail.
I checked some of solutions and it is advised to set property
mailProps.put("mail.smtp.starttls.enable", "true"),
but as I am setting configurations in POM not able to understand what tag should be used to set starttls as true.
plugin set in POM for email:
<plugin>
<groupId>ch.fortysix</groupId>
<artifactId>maven-postman-plugin</artifactId>
<version>0.1.6</version>
<executions>
<execution>
<id>send a mail</id>
<phase>test</phase>
<goals>
<goal>send-mail</goal>
</goals>
<inherited>true</inherited>
<configuration>
<!-- From Email address -->
<from>emailname@in.health.com</from>
<!-- Email subject -->
<subject>Test Automation Report</subject>
<!-- Fail the build if the mail doesnt reach -->
<failonerror>true</failonerror>
<!-- host -->
<mailhost>smtp.office365.com</mailhost>
<!-- port of the host -->
<mailport>587</mailport>
<mailssl>false</mailssl>
<mailAltConfig>true</mailAltConfig>
<!-- Email Authentication(USername and Password) -->
<mailuser>emailname@in.health.com</mailuser>
<mailpassword>password</mailpassword>
<receivers>
<!-- To Email address -->
<receiver>emailName@in.health.com</receiver>
</receivers>
<fileSets>
<fileSet>
<!-- Report directory Path -->
<directory>C://Users//narayan//git//com.rxcorp//PlaftformAutomation//test-output</directory>
<includes>
<!-- Report file name -->
<include>customized-emailable-report.html</include>
</includes>
<!-- Use Regular Expressions like **/*.html if you want all the html files to send-->
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>