Skip to content
Back

[SOLVED] Custom SMTP server cant connect

  • 0
  • Self Hosted
  • Web
BloodThermic
1 Dec, 2023, 08:55

I am trying to set up custom SMTP server but no matter what I do it wont connect. I was able to login on outlook using the exact same credentials and it worked just fine. I get a 400 Bad Request error when it fails.

TL;DR
User is encountering issues with connecting to a custom SMTP server. They have tried different ports and tested connecting from the server. They receive a `400 Bad Request` error when it fails. The solution is to switch to port 25, which successfully connects to the SMTP server.
BloodThermic
1 Dec, 2023, 09:42
TypeScript
_APP_SMTP_HOST=
_APP_SMTP_PORT=
_APP_SMTP_SECURE=
_APP_SMTP_USERNAME=
_APP_SMTP_PASSWORD=
_APP_SYSTEM_EMAIL_NAME=
_APP_SYSTEM_EMAIL_ADDRESS=
_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=

All of these are filled I have removed all info to make sure I dont expose anything I should not

Drake
1 Dec, 2023, 14:32

So what exactly is happening? What error do you get? Have you tested connecting from your server?

BloodThermic
1 Dec, 2023, 16:23

What do you mean connecting from your server.

BloodThermic
1 Dec, 2023, 16:23

When I go to set up the smtp account it errors about after about 10 mins and tells me it cant connect to SMTP server.

BloodThermic
1 Dec, 2023, 16:25
Drake
1 Dec, 2023, 17:13

what was the response body?

Drake
1 Dec, 2023, 17:13

ssh into your server and try connecting to the SMTP provider

BloodThermic
1 Dec, 2023, 17:36

My server is hosting it and I can ping it from the server.

BloodThermic
1 Dec, 2023, 17:37

I have one server that is split into vms with different dedicated ip address for each vm

BloodThermic
1 Dec, 2023, 17:37

I can ping mail.phelps.fit from my appwrite server

Drake
1 Dec, 2023, 17:42

What port did you set for _APP_SMTP_PORT?

BloodThermic
1 Dec, 2023, 17:50

465

Drake
1 Dec, 2023, 17:50

I think that's an SSL port but you can try doing telnet <host> 465

BloodThermic
1 Dec, 2023, 22:24

switched to port 25 and it worked

Drake
2 Dec, 2023, 00:12

Do you have tls enabled?

BloodThermic
2 Dec, 2023, 00:13

Yes

BloodThermic
2 Dec, 2023, 00:13

As always thanks for your amazing help

BloodThermic
2 Dec, 2023, 00:14

[Solved] Custom SMTP server cant connect

Drake
2 Dec, 2023, 00:14

[SOLVED] Custom SMTP server cant connect

Drake
2 Dec, 2023, 00:14

👍 but I didn't even do anything 😅

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more