How to enable STARTLS in maven Postman-plugin

断了今生、忘了曾经 提交于 2021-01-28 12:04:28

问题


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.

  1. How to Enable STARTLS
  2. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!