问题
I am trying to send a mail during package phase. I am using mail host : smtp.gmail.com. Port: 587.
Getting error: Must issue a STARTTLS command first.
When we use 587 - we must enable STARTLS - but how can I enable using Maven Postman Plugin.
- How to Enable STARTLS
- what is the purpose of mailAltConfig tag in plugin configuration.
BUILD ERROR:
BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.386 s
[INFO] Finished at: 2015-03-15T02:35:26+05:30
[INFO] Final Memory: 17M/173M
[INFO] ------------------------------------------------------------------------
[ERROR] Sending the email to the following server failed : smtp.gmail.com:587: 530 5.7.0 Must issue a STARTTLS command first. y2sm9686661pdm.31 - gsmtp ->
I have configured Postman Plugin as:
<plugin>
<groupId>ch.fortysix</groupId>
<artifactId>maven-postman-plugin</artifactId>
<executions>
<execution>
<id>send a mail</id>
<phase>package</phase>
<goals>
<goal>send-mail</goal>
</goals>
<inherited>false</inherited>
<configuration>
<from>donthadineshkumar@gmail.com</from>
<subject>My Project Documentation</subject>
<failonerror>true</failonerror>
<mailhost>smtp.gmail.com</mailhost>
<mailport>587</mailport>
<mailAltConfig>true</mailAltConfig>
<mailuser>donthadineshkumar</mailuser>
<mailpassword>*my password*</mailpassword>
<htmlMessageFile>src/main/MailContent.html</htmlMessageFile>
<receivers>
<receiver>donthadineshkumar.ddk@gmail.com</receiver>
</receivers>
<fileSets>
<fileSet>
<directory>${basedir}/src/main</directory>
<includes>
<include>**/*.pdf</include>
</includes>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
回答1:
if i am not using ssl and using 567 port i am facing the same issue as you.
To solve this I used
<mailssl>true</mailssl>
<mailport>465</mailport>
and i was successful
来源:https://stackoverflow.com/questions/29054411/how-to-enable-startls-in-maven-postman-plugin