title: How to solve "Error connecting to SMTP host: [Errno 10061] No connection could be made because the target machine actively refused it''?
body: <p>I am creating an application where I need to send mail for some particular logs.
  Here is my rule file: </p>
  
  <pre><code>es_host: localhost
  es_port: 9200
  name: Log Level Test
  type: frequency
  index: testindexv4
  num_events: 1
  timeframe:
     hours: 4
  filter:
   - term:
       log_level.keyword: "ERROR"
   - query:
       query_string:
         query: "log_level.keyword: ERROR"
  alert:
  - "email"
  email:
  - "&lt;mailId&gt;@gmail.com"
  </code></pre>
  
  <p>Here is the config.yaml</p>
  
  <pre><code>rules_folder: myrules
  run_every:
    seconds: 2
  buffer_time:
    seconds: 10
  es_host: localhost
  es_port: 9200
  writeback_index: elastalert_status
  alert_time_limit:
    days: 2
  </code></pre>
  
  <p>Here is smpt_auth.yaml</p>
  
  <pre><code>alert:
   - email
  email:
   - "&lt;mailId&gt;@gmail.com"
  smtp_host: "smtp.gmail.com" 
  smtp_port: 587 
  smtp_ssl: true
  from_addr: "&lt;mailId&gt;@gmail.com"
  smtp_auth_file: 'D:\ELK_Info\ElastAlert\elastalert-master\smtp_auth_user.yaml'
  </code></pre>
  
  <p>Here is smtp_auth_user.yaml</p>
  
  <pre><code>user: "&lt;mailId&gt;@gmail.com"
  password: "&lt;password&gt;"
  </code></pre>
  
  <p>When I run this command:</p>
  
  <pre><code>python -m elastalert.elastalert --verbose --rule myrules\myrule.yaml
  </code></pre>
  
  <p>I get an error as: </p>
  
  <pre><code>ERROR:root: Error while running alert email: Error connecting to SMTP host: [Errno 10061] No connection could be made because the target machine actively refused it.
  </code></pre>
  
  <p>Any idea on how to resolve the same, please?</p>