title: Alertmanager container can't send SMTP email because the connection refused from web hook
body: <p>I am using Prometheus/Grafana/Alertmanager docker images for monitoring my service. I created the <code>rules.yml</code> and added it into the <code>prometheus.yml</code>. It worked fine, I saw the ALERTS metrics when the system was overload. Then these alerts were sent to alermanager, the alertmanager was not able to send the messages to SMTP server.</p>
  <p>It showed the error</p>
  <blockquote>
  <p>level=warn ts=2021-03-25T07:07:17.526Z caller=notify.go:674 component=dispatcher receiver=web.hook integration=webhook[0] msg=&quot;Notify attempt failed, will retry later&quot; attempts=1 err=&quot;Post &quot;http://127.0.0.1:5001/&quot;: dial tcp 127.0.0.1:5001: connect: connection refused&quot;</p>
  </blockquote>
  <p>I think the error was related to the web_hook configuration but I did not set it in my <code>alertmanager.yml</code>, I was using email_config. I tested the <code>alermanager.yml</code> by creating the system service, it sent emails to the receiver when an alert was triggered so I am quite sure my configuration is not wrong.</p>
  <p>Here is my configruration in <code>alertmanager.yml</code></p>
  <pre><code>global:
    # The smarthost and SMTP sender used for mail notifications.
    smtp_smarthost: 'smtp.sendgrid.net:587'
    smtp_from: 'sample@gmail.com&gt;'
    smtp_auth_username: 'apikey'
    smtp_auth_password: 'sample'
  
  route:
    group_by: [alertname]
    # default receive
    receiver: default-alert
    group_wait: 30s
    group_interval: 2m
    repeat_interval: 3h
    routes:
      - match:
          alertname: PrometheusTargetMissing
        receiver: demo-alert
  
  receivers:
  - name: 'demo-alert'
    email_configs:
    - to: 'admin@gmail.com'
      # send_resolved: true
      headers: 
        Subject: &quot;system alert&quot;
  
  </code></pre>
  <p>Do you met this error before? I really approciate your help.</p>