# Logstash plugin mail error

**URL:** <https://discuss.elastic.co/t/logstash-plugin-mail-error/89964>\
**Category:** Logstash\
**Created:** [June 19, 2017, 3:47pm UTC](https://discuss.elastic.co/t/logstash-plugin-mail-error/89964 "2017-06-19T15:47:08Z")\
**Posts on this page:** 4\
**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 19, 2017, 3:47pm UTC](https://discuss.elastic.co/t/logstash-plugin-mail-error/89964/1 "2017-06-19T15:47:08Z")

</div>

Hi every body,  
i use mail plugin in logstash but doesn't work.i get this error:

```
[ERROR][logstash.outputs.email] Something happen while delivering an email {:exception=>#<EOFError: End of file reached

```

this my config:

```
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"
  codec => "plain"
  contenttype => "text/html; charset=UTF-8"
  body => "Here is the event line that occured: %{message}"
  address => "smtp.gmail.com"
  port => 465
  username => "mycompte"
  password => "password"
  use_tls => true
  }
  stdout { codec => rubydebug }
}

```

any help would be 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 19, 2017, 9:28pm UTC](https://discuss.elastic.co/t/logstash-plugin-mail-error/89964/2 "2017-06-19T21:28:43Z")

</div>

I'm pretty sure you shouldn't be using port 465 with `use_tls`. The latter options enables SMTP with STARTTLS support which typically runs on port 25 or 587. Port 465 is SMTPS, i.e. SSL-wrapped SMTP.

---

<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 20, 2017, 9:34am UTC](https://discuss.elastic.co/t/logstash-plugin-mail-error/89964/3 "2017-06-20T09:34:28Z")

</div>

Thank you so much @magnusbaeck.it works fine with the port 587.but deosn't work with 25.  
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 18, 2017, 9:34am UTC](https://discuss.elastic.co/t/logstash-plugin-mail-error/89964/4 "2017-07-18T09:34:56Z")

</div>

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