For the complete documentation index, see llms.txt. This page is also available as Markdown.

Export artifacts by email

Use the Email plugin to export reports and other artifacts by email.

You can use the Email plugin to export reports, data, and other artifacts by email.

Use the Email plugin

  1. Add an SMTP configuration in Harness. Username and Password are not required.

  2. Make sure your pipeline produces the artifact that you wan to include in the email, such as a .txt, .html, or .csv file. For example:

                  - step:
                      type: Run
                      name: Run_1
                      identifier: Run_1
                      spec:
                        connectorRef: YOUR_DOCKER_CONNECTOR_ID
                        image: alpine
                        shell: Sh
                        command: |-
                          touch test.html
    
                          echo "My Test HTML" > test.html
    
                          cat test.html
  3. Use the Email plugin in a Plugin step, for example:

                  - step:
                      type: Plugin
                      name: Plugin_1
                      identifier: Plugin_1
                      spec:
                        connectorRef: YOUR_DOCKER_CONNECTOR_ID
                        image: plugins/email ## This is the email plugin image.
                        settings:
                          from.name: Harness CI ## The sender name
                          from.address: sender@mysite.com ## The email address to send the notification from. Can be the same as the From Address in your Harness SMTP configuration.
                          recipients: test@mysite.com ## List of recipients to send the email to (besides the commit author).
                          host: smtp.somesmtpserver.com ## SMTP server address from your Harness SMTP configuration.
                          port: "25" ## SMTP server port from your Harness SMTP configuration.
                          skip_verify: "true" ## Set to 'true' to skip cert verification.
                          subject: somesubject ## Subject line.
                          body: file:///harness/test.html ## The email body. This can be an inline template or a URL. `file:///` is allowed.
                          recipients_only: true

For information about Email plugin settings, go to the Email plugin documentation.

For information about the Plugin step settings, go to the Plugin step settings documentation.

Send with username and password authentication

You don't need to provide the SMTP username and password, but you can include these parameters if you want or need to. For information about Email plugin settings, including the username and password, go to the Email plugin documentation.

Send data in the body

You can send the data either in the body of the email or as an attachment.

Here's an example of a Plugin step where the data is in the email body.

Send data as an attachment

You can send the data either in the body of the email or as an attachment.

Here's an example of a Plugin step where the data is sent as an attachment.

Last updated

Was this helpful?