How to properly configure SMTP via docker compose?

Had a problem, after fully configuring smtp via docker compose I get a send error, is it possible to disable email sending in principle? I have my template microservice also built on nodemailer, running in docker and fully working, the network between containers is fully configured, how to disable email sending in directus, for example if I access /users/invite and want to get invite_url, but directus doesn’t give the link before sending email.

By the way, my email sending microservice works and is configured on google smtp with 465 port, but when I configure directus in the same way, I get a sending error.

Here are all the settings I used last time but with port 587:

 EMAIL_FROM: ${EMAIL_USER}
 EMAIL_TRANSPORT: "smtp"
 EMAIL_SMTP_HOST: "smtp.gmail. com"
 EMAIL_SMTP_PORT: "587"
 EMAIL_SMTP_USER: ${EMAIL_USER}
 EMAIL_SMTP_PASSWORD: ${EMAIL_PASSWORD}
 EMAIL_SMTP_POOL: false
 EMAIL_SMTP_SECURE: false
 EMAIL_VERIFY_SETUP: true
 EMAIL_SMTP_IGNORE_TLS: false
 EMAIL_SMTP_TLS: true
 EMAIL_SMTP_NAME: "Some dude"

Here’s the error I’m getting:

ERROR: Could not send user invitation mail
    err: {
      "type": "Error",
      "message": "Connection closed unexpectedly",
      "stack":
          Error: Connection closed unexpectedly
              at SMTPConnection._onClose (/directus/node_modules/.pnpm/nodemailer@6.10.0/node_modules/nodemailer/lib/smtp-connection/index.js:863:34)
              at SMTPConnection._onSocketClose (/directus/node_modules/.pnpm/nodemailer@6.10.0/node_modules/nodemailer/lib/smtp-connection/index.js:197:42)
              at Object.onceWrapper (node:events:633:26)
              at TLSSocket.emit (node:events:530:35)
              at node:net:351:12
              at TCP.done (node:_tls_wrap:650:7)
      "code": "ECONNECTION",
      "command": "CONN"
    }

Is that space in your config or just a copy paste error?