Back

Could not connect to SMTP server, self-hosted on localhost - smtp4dev

  • 0
  • Self Hosted
  • Web
Barceló
22 Mar, 2024, 18:13

I'm testing appwrite 1.4.13 with nextjs on localhost, for development test I have smtp4dev.

_APP_SMTP_HOST=localhost _APP_SMTP_PORT=25 _APP_SMTP_SECURE=false _APP_SMTP_USERNAME= _APP_SMTP_PASSWORD= _APP_SMS_PROVIDER= .... $telnet localhost 25 Trying ::1... Connected to localhost. Escape character is '^]'. 220 smtp4dev smtp4dev ready

On appwrite console, settings smtp, I try config Server host: localhost user: test passw: test

but not working. Could not connect to SMTP server

TL;DR
Developers are having trouble connecting to their self-hosted SMTP server on localhost while using smtp4dev for testing. The solution is to replace `localhost` with the computer's internal IP address, which can be found by running `ifconfig` on Unix-based systems. Additionally, try using empty strings for the username and password in the configuration file.
Binyamin
22 Mar, 2024, 18:18

Try with empty strings for the username and password

TypeScript
_APP_SMTP_HOST=localhost
_APP_SMTP_PORT=25
_APP_SMTP_SECURE=false
_APP_SMTP_USERNAME=""
_APP_SMTP_PASSWORD=""
Barceló
22 Mar, 2024, 18:34

but, the problem is on console, the fields user, passw are required... and not connect with localhost... https://ibb.co/x7sqmGf

Binyamin
22 Mar, 2024, 18:35

Ohh You'll need to change something

Binyamin
22 Mar, 2024, 18:35

Is this a local or remote deployment?

Binyamin
22 Mar, 2024, 18:37

You'll need to put the computer's internal IP You'll get by running ifconfig in unix based systems

Binyamin
22 Mar, 2024, 18:38

Then replace localhost with it, for example 172.24.0.1

Barceló
22 Mar, 2024, 18:42

is local development all in the same pc... https://ibb.co/bg71M0G

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