<commit_before>---
author: "drillster"
date: 2017-01-31T08:00:35+01:00
image: "drillster/drone-email"
repo: "drillster/drone-email"
tags: [ notifications, email ]
logo: email.svg
title: Email
---

The email plugin can be used to notify people of a build result.

The example configuration below will send an email to the build's author and the configured `recipients` (<EMAIL> and <EMAIL>) when a build result changes or when it fails.
It will use the `username` and `password` to connect to `host` and send emails from `from`.
```yaml
pipeline:
  notify:
    image: drillster/drone-email
    host: smtp.some-server.com
    username: foo
    password: <PASSWORD>
    from: <EMAIL>
    when:
      status: [ changed, failure ]
```

You can have the plugin send mails to a pre-configured list of `recipients` by default:

```diff
pipeline:
  notify:
    image: drillster/drone-email
    host: smtp.some-server.com
    username: foo
    password: <PASSWORD>
    from: <EMAIL>
+   recipients: <EMAIL>,<EMAIL>
    when:
      status: [ changed, failure ]
```

If you do not want to send a mail to the build's author (but only to `recipients`), use the `recipients_only` parameter:

```diff
pipeline:
  notify:
    image: drillster/drone-email
    host: smtp.some-server.com
    username: foo
    password: <PASSWORD>
    from: <EMAIL>
    recipients: <EMAIL>,<EMAIL>
+   recipients_only: true
    when:
      status: [ changed, failure ]
```

Should you want to skip SMTP server certificate verification, use the `skip_verify` parameter:

```diff
pipeline:
  notify:
    image: drillster/drone-email
    host: smtp.some-server.com
+   skip_verify: true
    username: foo
    password: <PASSWORD>
    from: <EMAIL>
    recipients: <EMAIL>,<EMAIL>
    when:
      status: [ changed, failure ]
```

{{% alert warn %}}
Keep in mind that you should use secrets for sensitive parts of the configuration!
{{% /alert %}}

# Parameter Reference

from
: Send notifications from this address

host
: SMTP server host

port
: SMTP server port, defaults to `587`<commit_msg>Change recipients value to a yaml list<commit_after>---
author: "drillster"
date: 2017-01-31T08:00:35+01:00
image: "drillster/drone-email"
repo: "drillster/drone-email"
tags: [ notifications, email ]
logo: email.svg
title: Email
---

The email plugin can be used to notify people of a build result.

The example configuration below will send an email to the build's author and the configured `recipients` (<EMAIL> and <EMAIL>) when a build result changes or when it fails.
It will use the `username` and `password` to connect to `host` and send emails from `from`.
```yaml
pipeline:
  notify:
    image: drillster/drone-email
    host: smtp.some-server.com
    username: foo
    password: <PASSWORD>
    from: <EMAIL>
    when:
      status: [ changed, failure ]
```

You can have the plugin send mails to a pre-configured list of `recipients` by default:

```diff
pipeline:
  notify:
    image: drillster/drone-email
    host: smtp.some-server.com
    username: foo
    password: <PASSWORD>
    from: <EMAIL>
+   recipients: [ <EMAIL>, <EMAIL> ]
    when:
      status: [ changed, failure ]
```

If you do not want to send a mail to the build's author (but only to `recipients`), use the `recipients_only` parameter:

```diff
pipeline:
  notify:
    image: drillster/drone-email
    host: smtp.some-server.com
    username: foo
    password: <PASSWORD>
    from: <EMAIL>
    recipients: [ <EMAIL>, <EMAIL> ]
+   recipients_only: true
    when:
      status: [ changed, failure ]
```

Should you want to skip SMTP server certificate verification, use the `skip_verify` parameter:

```diff
pipeline:
  notify:
    image: drillster/drone-email
    host: smtp.some-server.com
+   skip_verify: true
    username: foo
    password: <PASSWORD>
    from: <EMAIL>
    when:
      status: [ changed, failure ]
```

{{% alert warn %}}
Keep in mind that you should use secrets for sensitive parts of the configuration!
{{% /alert %}}

# Parameter Reference

from
: Send notifications from this address

host
: SMTP server host

port
: SMTP server port, defaults to `587`
{'fraction_non_alphanumeric': 0.10886998784933172, 'fraction_numerical': 0.010206561360874849, 'mean_word_length': 3.498360655737705, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7043639', 'n_tokens_mistral': 1370, 'n_tokens_neox': 1307, 'n_words': 477}