<@U04UQ68083H> I’m configuring Kratos to send emai...
# ory-copilot
d
@chilly-king-10285 I’m configuring Kratos to send emails via smtp (rather than smtps) for local testing. I’m using this connection string
<smtp://test:test@localhost:1025/?disable_starttls=true&skip_ssl_verify=true>
and have also tried this
<smtp://test:test@localhost:1025/?disable_starttls=true>
and this
<smtp://test:test@localhost:1025/>
but I keep getting this error :
application error=map[message:dial tcp 127.0.0.1:1025: connect: connection refused
which is odd because other applications are able to use this mail server. Any ideas?
c
A message from kapa.ai
The error message
dial tcp 127.0.0.1:1025: connect: connection refused
typically indicates that the application is unable to establish a connection to the specified server and port. This could be due to several reasons such as the server not running, the server not listening on the specified port, or network issues. Given that other applications are able to use this mail server, it's likely that the server is running and the network is fine. Therefore, the issue might be with the configuration of Ory Kratos. Here are a few things you could check: 1. Ensure that the SMTP server is running and listening on the correct port (1025 in your case). 2. Verify that the connection string is correctly formatted. According to the [Ory documentation](https://www.ory.sh/docs/kratos/emails-sms/sending-emails-smtp#smtp-security-mechanisms), the connection string for Cleartext SMTP (which is often used in development environments and uses no encryption) should be in the format:
<smtp://username:password@server:port/?disable_starttls=true>
. 3. Check if there are any firewalls or security groups that might be blocking the connection from Ory Kratos to the SMTP server. 4. Make sure that Ory Kratos is correctly configured to use your SMTP server. According to the [Ory documentation](https://www.ory.sh/docs/kratos/emails-sms/sending-emails-smtp), you can configure Ory to use a custom SMTP server by adding the configuration for your custom SMTP server in the Ory Identities config file. If you've checked all of these and are still experiencing the issue, it might be helpful to look at the logs of both Ory Kratos and the SMTP server to see if there are any additional error messages that could help diagnose the problem.