# java.lang.IllegalArgumentException: no accounts of type \[email\] configured. Please set up an account using the \[xpack.notification.email\] settings

**URL:** <https://discuss.elastic.co/t/java-lang-illegalargumentexception-no-accounts-of-type-email-configured-please-set-up-an-account-using-the-xpack-notification-email-settings/123798>\
**Category:** Elasticsearch\
**Created:** [March 13, 2018, 8:02pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-no-accounts-of-type-email-configured-please-set-up-an-account-using-the-xpack-notification-email-settings/123798 "2018-03-13T20:02:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [March 15, 2018, 7:54pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-no-accounts-of-type-email-configured-please-set-up-an-account-using-the-xpack-notification-email-settings/123798/2 "2018-03-15T19:54:49Z")

</div>

Configured the gmail account set up in elasticsearch.yml and allowed 2 step verification for it.

```auto
xpack.notification:
   email.account.gmail_account:
       smtp:
            auth: true
            starttls.enable: true
            host: smtp.gmail.com
            port: 587
            user: xxx@gmail.com
            password: xxxxxx

```

This config worked for me on 6.2 and I do receive emails via watcher email action. Can you please verify your config?

Thanks  
Rashmi

---

_[View the full topic](https://discuss.elastic.co/t/java-lang-illegalargumentexception-no-accounts-of-type-email-configured-please-set-up-an-account-using-the-xpack-notification-email-settings/123798)._
