# SMTP does not work

**URL:** <https://vaultwarden.discourse.group/t/smtp-does-not-work/1806>\
**Category:** Help\
**Created:** [August 11, 2022, 11:47am UTC](https://vaultwarden.discourse.group/t/smtp-does-not-work/1806 "2022-08-11T11:47:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shprd95](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/shprd95/32/728_2.png) [@shprd95](https://vaultwarden.discourse.group/u/shprd95)\
**Post date:** [August 11, 2022, 11:47am UTC](https://vaultwarden.discourse.group/t/smtp-does-not-work/1806/1 "2022-08-11T11:47:06Z")

</div>

Hello everyone! i’m trying to configure SMTP and getting this error. Is anyone having similar problem?

```auto
vaultwarden | [2022-08-11 09:19:37.767][vaultwarden::mail][ERROR] SMTP Connection error: Connection error: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:../ssl/statem/statem_clnt.c:1914: (Hostname mismatch)
vaultwarden | [2022-08-11 09:19:37.768][response][INFO] (test_smtp) POST /admin/test/smtp => 400 Bad Request

```

That’s how my configuration looks:

```auto
version: '3'

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: always
    volumes:
      - ./vw-data:/data
    ports:
      - 8732:80
    environment:
      WEBSOCKET_ENABLED: "true" # Enable WebSocket notifications.
      SIGNUPS_ALLOWED: "false"
      #SIGNUPS_DOMAINS_WHITELIST: "example.com"
      #SIGNUPS_VERIFY: "true"

      SMTP_HOST: smtp.exampe.com
      SMTP_FROM: vaultwarden@exampe.com
      SMTP_FROM_NAME: Password vault
      SMTP_PORT: 587
      SMTP_SECURITY: starttls
      SMTP_USERNAME: vaultwarden@exampe.com
      SMTP_PASSWORD: Password!

```

---

<div class="post-metadata">

**Author:** ![techz.one](https://avatars.discourse-cdn.com/v4/letter/t/94ad74/32.png) [@techz.one](https://vaultwarden.discourse.group/u/techz.one)\
**Post date:** [August 18, 2022, 10:35am UTC](https://vaultwarden.discourse.group/t/smtp-does-not-work/1806/2 "2022-08-18T10:35:53Z")

</div>

Hi,

are you trying to use your own SMTP server or a public one? The message `Hostname mismatch` typically means that there is a mismatch between the SMTP server hostname you provided and the hostname (and SAN) in the SSL certificate.

I can’t find an option to ignore SSL warnings (which you should fix instead of ignoring them): [SMTP Configuration · dani-garcia/vaultwarden Wiki · GitHub](https://github.com/dani-garcia/vaultwarden/wiki/SMTP-configuration)

Maybe you could give a bit more information about your setup.

Wolfgang
