title: How to send email with attachment in jenkinsfile (Groovy Script)?
body: <p>I want to send email after post build action in jenkins. Hence I have write jenkinsfile as follows. But I need some groovy script for
  1. Attachment for zip file
  2. Before attaching the file , I need to convert the folder to zip format.</p>
  
  <p>Note: Please don't suggest email plugin procedure &amp; configuration.
  I preferred Jenkins file method configuration</p>
  
  <pre><code> pipeline {
      agent any
      stages {
          stage('Testing') {
              steps {
                  sh 'chmod +x mvnw'
                  sh './mvnw clean verify serenity:aggregate'
              }
          }
      }
      post {
          failure {
              script {
                  mail (to: 'email@gmail.com',
                          subject: "Job '${env.JOB_NAME}' (${env.BUILD_NUMBER}) failed",
                          body: "Please visit ${env.BUILD_URL} for further information"
                  );
                  }
              }
           success {
               script {
                  mail (to: 'email@gmail.com',
                          subject: "Job '${env.JOB_NAME}' (${env.BUILD_NUMBER}) success.",
                          body: "Please visit ${env.BUILD_URL} for further information.",
  
  
                    );
                  }
            }      
      }
  }
  </code></pre>