# Error sending email

**URL:** <https://tiledesk.discourse.group/t/error-sending-email/180>\
**Category:** Technical issue\
**Created:** [October 11, 2022, 9:04am UTC](https://tiledesk.discourse.group/t/error-sending-email/180 "2022-10-11T09:04:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbeyer](https://avatars.discourse-cdn.com/v4/letter/k/8c91f0/32.png) [@kbeyer](https://tiledesk.discourse.group/u/kbeyer)\
**Post date:** [October 11, 2022, 9:04am UTC](https://tiledesk.discourse.group/t/error-sending-email/180/1 "2022-10-11T09:04:37Z")

</div>

We installed Tiledesk as docker version on a Debian 11 Bullseye server.  
Exim4 is configured to listen on the docker interface (172.17.0.1) on port 25. Port 25 is configured in the Tiledesk docker-compose.yml and EMAIL\_SECURE is set to false:  
- EMAIL\_ENABLED=true  
- EMAIL\_HOST=172.17.0.1  
- EMAIL\_USERNAME=  
- EMAIL\_SECURE=false  
- EMAIL\_PORT=25  
- EMAIL\_PASSWORD=

If we resend an agent invitation, we get the error:  
Error sending email {“error”: {“code”:“ESOCKET”,“command”:“CONN”,“function”:“ssl3\_get\_record”,“library”:“SSL routines”,“reason”:“wrong version number”}  
If I check in root shell with “openssl s\_client -connect localhost:25 -starttls smtp” everything is fine.  
If I open a shell in the docker container tiledesk-server, I get no error too when trying  
openssl s\_client -connect 172.17.0.1:25 -starttls smtp

---

<div class="post-metadata">

**Author:** ![andrealeo](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@andrealeo](https://tiledesk.discourse.group/u/andrealeo)\
**Post date:** [October 11, 2022, 1:13pm UTC](https://tiledesk.discourse.group/t/error-sending-email/180/2 "2022-10-11T13:13:08Z")

</div>

Duplicate of this [Email configurations](https://tiledesk.discourse.group/t/email-configurations/138)  
Regards  
Andrea

---

<div class="post-metadata">

**Author:** ![kbeyer](https://avatars.discourse-cdn.com/v4/letter/k/8c91f0/32.png) [@kbeyer](https://tiledesk.discourse.group/u/kbeyer)\
**Post date:** [October 13, 2022, 9:17am UTC](https://tiledesk.discourse.group/t/error-sending-email/180/3 "2022-10-13T09:17:27Z")

</div>

the difference to [Email configurations](https://tiledesk.discourse.group/t/email-configurations/138) is that we have set EMAIL\_SECURE=false.

As this is a local smtp server which only listens on localhost, port 465 and 587 are not enabled. It listens only on port 25.

Regarding [Email parameters and templates configuration - Tiledesk Developer Hub](https://developer.tiledesk.com/configuration/email) this should be fine:

**EMAIL\_SECURE** =true #defaults to 587 if is secure is false or 465 if true If true the connection will use TLS when connecting to server. If false (the default) then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false.

**EMAIL\_PORT** =25 Is the port to connect to (defaults to 587 if is secure is false or 465 if true)

BTW: I enabled port 465 and set EMAIL\_SECURE=true but no mail could be sent too.

---

<div class="post-metadata">

**Author:** ![andrealeo](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@andrealeo](https://tiledesk.discourse.group/u/andrealeo)\
**Post date:** [October 18, 2022, 10:44am UTC](https://tiledesk.discourse.group/t/error-sending-email/180/4 "2022-10-18T10:44:47Z")

</div>

We fixed the issue with the new tiledesk-server: 2.3.36.  
We just released a new version of the Docker Compose installation with that tiledesk-server version.  
Can you try now?  
When you try with the new version please delete the old docker-compose.yml file  
Thank you for the feedback

---

<div class="post-metadata">

**Author:** ![kbeyer](https://avatars.discourse-cdn.com/v4/letter/k/8c91f0/32.png) [@kbeyer](https://tiledesk.discourse.group/u/kbeyer)\
**Post date:** [October 18, 2022, 12:19pm UTC](https://tiledesk.discourse.group/t/error-sending-email/180/5 "2022-10-18T12:19:23Z")

</div>

Hello Andrea,  
thank you for the fixed version. Mail sending via local Exim smtp server on port 25 works now fine.
