# Output email plugin

**URL:** <https://discuss.elastic.co/t/output-email-plugin/89580>\
**Category:** Logstash\
**Created:** [June 15, 2017, 2:57pm UTC](https://discuss.elastic.co/t/output-email-plugin/89580 "2017-06-15T14:57:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)\
**Post date:** [June 15, 2017, 2:57pm UTC](https://discuss.elastic.co/t/output-email-plugin/89580/1 "2017-06-15T14:57:38Z")

</div>

Hi there i want to use email plugin.i get this error:

`Cannot create pipeline {:reason=>"Couldn't find any output plugin named 'email'`

this is pipeline.conf:

```
output {
if	"ERROR" in [LEVEL]
{
elasticsearch {
  hosts=>"localhost:9200"
  }
  }
  email {
        options => [ "smtpIporHost", "smtp.gmail.com",
         "port", "587",
         "userName", "user",
         "password", "mypassword",
         "authenticationType", "plain",
         "starttls","true"
           ]
            from => "transmitter"
            subject => "logstash alert"
            to => "receiver"
            via => "smtp"
            body => "Here is the event line that occured: %{message}"
       }
stdout { codec => rubydebug }
}

```

Any help is greatly appreciate.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 15, 2017, 3:21pm UTC](https://discuss.elastic.co/t/output-email-plugin/89580/2 "2017-06-15T15:21:15Z")

</div>

Install the plugin as explained in its documentation.

---

<div class="post-metadata">

**Author:** ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)\
**Post date:** [June 15, 2017, 3:42pm UTC](https://discuss.elastic.co/t/output-email-plugin/89580/3 "2017-06-15T15:42:34Z")

</div>

Yes,thank you for your help.now i get this error:

```
Unknown setting 'options' for email
Cannot create pipeline {:reason=>"Something is wrong with your configuration."

```

this is pipeline.conf  
output {  
email {  
to =\> "receiver"  
codec =\> "plain"  
contenttype =\> "text/html; charset=UTF-8"  
options =\> {  
smtpIporHost =\> "[smtp.gmail.com](http://smtp.gmail.com)"  
port =\> 465  
userName =\> "user"  
password =\> "password"  
starttls =\> true  
}  
}  
}  
thanks.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 15, 2017, 3:55pm UTC](https://discuss.elastic.co/t/output-email-plugin/89580/4 "2017-06-15T15:55:41Z")

</div>

I believe the `options` setting was removed a while back. Again, look at the email plugin documentation. It tells you which settings are available to you.

---

<div class="post-metadata">

**Author:** ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)\
**Post date:** [June 15, 2017, 4:08pm UTC](https://discuss.elastic.co/t/output-email-plugin/89580/5 "2017-06-15T16:08:40Z")

</div>

I followed the documentation.now i this get error:

`Something happen while delivering an email {:exception=>#<Errno::ECONNREFUSED: Connection refused - Connection refused`

```
output {
 email {
  to => "receiver"
  address => "localhost"
  codec => "plain"
  contenttype => "text/html; charset=UTF-8"
  via => "smtp"
  port => 25
  domain => "localhost"
  from => "logstash.alert@nowhere.com"
  subject => "Test"
  use_tls => false

  }
}
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 15, 2017, 4:21pm UTC](https://discuss.elastic.co/t/output-email-plugin/89580/6 "2017-06-15T16:21:50Z")

</div>

But this isn't equivalent to your previous configuration. Do you have an SMTP server running on localhost? Didn't you want to use Gmail instead?

---

<div class="post-metadata">

**Author:** ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)\
**Post date:** [June 15, 2017, 9:04pm UTC](https://discuss.elastic.co/t/output-email-plugin/89580/7 "2017-06-15T21:04:56Z")

</div>

I don't have SMTP server running on localhost,so,what is the configuration to be worked.

Thanks

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 15, 2017, 9:18pm UTC](https://discuss.elastic.co/t/output-email-plugin/89580/8 "2017-06-15T21:18:12Z")

</div>

I think all the options you specified in your first post have direct equivalents in the new version of the email output so it should be easy to translate them.

I'm not sure your original configuration is correct, though. Port 465 is for SMTPS (i.e. SSL-wrapped SMTP) but you tried to enable STARTTLS which typically is used with port 25 or 587 (never 465).

---

<div class="post-metadata">

**Author:** ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)\
**Post date:** [June 15, 2017, 9:32pm UTC](https://discuss.elastic.co/t/output-email-plugin/89580/9 "2017-06-15T21:32:42Z")

</div>

I am appreciate your help.this is my original configuration:

```
input {
        file {
        path => "c:/logstash.log"
        start_position => "beginning"
        sincedb_path => "/dev/null"
        codec => multiline {
        pattern => "^%{TIMESTAMP_ISO8601}"
        #negate => true
        what => "previous"
   }
        }
}
filter {
grok{
	  match => { "message" => "%{TIME:timestamp} %{LOGLEVEL:LEVEL} %{GREEDYDATA:errormsg}" }
	}
}
output {
 email {
  to => "receiver"
  address => "localhost"
  codec => "plain"
  contenttype => "text/html; charset=UTF-8"
  via => "smtp"
  port => 25
  domain => "localhost"
  from => "logstash.alert@nowhere.com"
  subject => "Test"
  use_tls => false
  }
}

```

Big thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 13, 2017, 9:33pm UTC](https://discuss.elastic.co/t/output-email-plugin/89580/10 "2017-07-13T21:33:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
