title: Sending email with attachment using Maven
body: <p>Using surefire plugin and postman plugin, I am able to generate a surefire report and send email to a recipient. But the surefire report (html) is not getting attached with the email. Recipient is getting an email without the attachment. If I run the project again, email has been delivered with the attachment. Following is my pom.xml. I don't know what I am missing. Please help.</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.testing.example&lt;/groupId&gt;
      &lt;artifactId&gt;SampleExample&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;name&gt;SampleExample&lt;/name&gt;
      &lt;version&gt;1.0.0&lt;/version&gt;
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.11&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;   
      &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;ch.fortysix&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-postman-plugin&lt;/artifactId&gt;
                  &lt;version&gt;0.1.6&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;send_an_mail&lt;/id&gt;
                          &lt;phase&gt;test&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;send-mail&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;inherited&gt;false&lt;/inherited&gt;
                          &lt;configuration&gt;
                              &lt;from&gt;xxxxxxxxxx&lt;/from&gt;
                              &lt;subject&gt;this is a test auto email sent from Eclipse using Maven&lt;/subject&gt;
                              &lt;htmlMessage&gt;
                              &lt;![CDATA[
                              &lt;p&gt;Hi, Please find attached.&lt;/p&gt;
                              ]]&gt;
                              &lt;/htmlMessage&gt;
                              &lt;failonerror&gt;true&lt;/failonerror&gt;
                              &lt;mailhost&gt;smtp.gmail.com&lt;/mailhost&gt;
                              &lt;mailport&gt;465&lt;/mailport&gt;
                              &lt;mailssl&gt;true&lt;/mailssl&gt;
                              &lt;mailAltConfig&gt;true&lt;/mailAltConfig&gt;
                              &lt;mailuser&gt;xxxxxxx&lt;/mailuser&gt;
                              &lt;mailpassword&gt;xxxxxxx&lt;/mailpassword&gt;
                              &lt;receivers&gt;
                                  &lt;receiver&gt;xxxxxxxxx&lt;/receiver&gt;
                              &lt;/receivers&gt;
  
                              &lt;fileSets&gt;
                                  &lt;fileSet&gt;
                                      &lt;directory&gt;${basedir}/target/site&lt;/directory&gt;
                                      &lt;includes&gt;
                                          &lt;include&gt;**/surefire-report.html&lt;/include&gt;
                                      &lt;/includes&gt;
                                  &lt;/fileSet&gt;
                              &lt;/fileSets&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
      &lt;reporting&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-surefire-report-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.18.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;testFailureIgnore&gt;true&lt;/testFailureIgnore&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/reporting&gt;
  &lt;/project&gt;
  </code></pre>