# Não consigo enviar e-mail - problema com a porta 465

**URL:** <https://meta.discourse.org/t/cannot-send-email-problem-with-port-465/246004>\
**Category:** Self-hosting\
**Tags:** email\
**Created:** [18 Novembro , 2022 04:11 UTC](https://meta.discourse.org/t/cannot-send-email-problem-with-port-465/246004 "2022-11-18T04:11:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)\
**Post date:** [18 Novembro , 2022 04:11 UTC](https://meta.discourse.org/t/cannot-send-email-problem-with-port-465/246004/1 "2022-11-18T04:11:29Z")

</div>

Gostaria de alterar o provedor de SMTP, mas não parece funcionar, embora tenha certeza de que o servidor pode enviar e-mails.

Tenho isto em `app.yml`:

```yml
  DISCOURSE_SMTP_ADDRESS: <<SMTP SERVER>>
  DISCOURSE_SMTP_PORT: 465
  DISCOURSE_SMTP_USER_NAME: <<USER>>
  DISCOURSE_SMTP_PASSWORD: <<PASSWORD>>

```

Usando `telnet <<SMTP SERVER>> 465` conecta OK, mas quando tento enviar e-mails, o Discourse retorna com:

```plaintext
ERROR - Net::ReadTimeout with #<Socket:(closed)>

```

Alguém tem alguma dica sobre o que preciso configurar?

Verifiquei o servidor com base neste tópico: [Troubleshoot email on a new Discourse install](https://meta.discourse.org/t/troubleshoot-email-on-a-new-discourse-install/16326)

Parece conectar ao servidor e enviar um e-mail de teste corretamente se eu fizer isso manualmente:

```plaintext
> sudo ./launcher enter app
root@support-app:/var/www/discourse# openssl s_client -connect mail.xxxxxxxx.com:465
  :
  :
  quantidade massiva de lixo
  :
  :
220 xxxxxxx.com Anti-spam GT for Coremail System (mispb-6da2110f-64b0-4d67-acf1-2d302bd594f9-xxxxxxx.com[20220915])
EHLO mail.xxxxxxxxx.com
250-mail
250-PIPELINING
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-coremail 1Uxr2xKj7kG0xkI17xGrUDI0s8FY2U3Uj8Cz28x1UUUUU7Ic2I0Y2UrpDiNKUCa0xDrUUUUj
250-STARTTLS
250-SMTPUTF8
250 8BITMIME
AUTH PLAIN xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
235 Authentication successful
mail from: <xxx@xxxxxx.com>
250 Mail OK
rcpt to: <xxxx@xxxxxxx.com>
250 Mail OK
data
354 End data with <CR><LF>.
content

.
250 Mail OK queued as AQAAfwBXr9nSGHdj3hEgAA--.7073S2

```

---

_[View the full topic](https://meta.discourse.org/t/cannot-send-email-problem-with-port-465/246004)._
