# Nextcloud App - set up email server doesn't work

**URL:** <https://forums.docker.com/t/nextcloud-app-set-up-email-server-doesnt-work/117038>\
**Category:** Docker Hub\
**Created:** [October 30, 2021, 8:26pm UTC](https://forums.docker.com/t/nextcloud-app-set-up-email-server-doesnt-work/117038 "2021-10-30T20:26:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmcloud](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/cmcloud/32/32563_2.png) [@cmcloud](https://forums.docker.com/u/cmcloud)\
**Post date:** [October 30, 2021, 8:26pm UTC](https://forums.docker.com/t/nextcloud-app-set-up-email-server-doesnt-work/117038/1 "2021-10-30T20:26:19Z")

</div>

Good evening,

I have a Nextcloud App running inside Docker and I have problems setting up the email configurations for smtp in the Nextcloud Basic Settings. When I try to send a test email i get an error message.

The email is hosted by ionos and I used the settings for smtp provided on the ionos homepage, but without success. I tried different encryption settings (none, SSL/TLS, STARTTLS) and ports (25, 465, 587). And all combinations of them.

Based on what I know about email one of these settings should work, so I don’t know what to do anymore. What could I do to set up the email server successfully? Do you have an idea why the problem occurs?

Error message: A problem occurred while sending the email. Please revise your settings. (Error: Connection could not be established with host [smtp.ionos.de](http://smtp.ionos.de) :stream\_socket\_client(): php\_network\_getaddresses: getaddrinfo failed: Name or service not known)

Operating system and version: Ubuntu 20.04.3 LTS  
Nextcloud version: 21.0.0

My config.php file:  
‘mail\_smtpmode’ =\> ‘smtp’,  
‘mail\_sendmailmode’ =\> ‘smtp’,  
‘mail\_from\_address’ =\> ‘xx’,  
‘mail\_domain’ =\> ‘xx’,  
‘mail\_smtphost’ =\> ’ [smtp.ionos.de](http://smtp.ionos.de) ',  
‘mail\_smtpport’ =\> ‘465’,  
‘mail\_smtpauthtype’ =\> ‘LOGIN’,  
‘mail\_smtpauth’ =\> 1,  
‘mail\_smtpname’ =\> 'xx,  
‘mail\_smtppassword’ =\> ‘xx’,  
‘mail\_smtpsecure’ =\> ‘ssl’,

Please let me know if I can provide further information and thank you for your help.

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [October 31, 2021, 12:04am UTC](https://forums.docker.com/t/nextcloud-app-set-up-email-server-doesnt-work/117038/2 "2021-10-31T00:04:12Z")

</div>

> [@cmcloud](#):
>
> ’ [smtp.ionos.de](http://smtp.ionos.de) ',

Are those spaces at the beginning and at the end of the domain name there for a reason? If the mailer does not remove those spaces that can be a problem. If not that, than it can be network setting issue in the container and it cannot resolve the existing domain.

---

<div class="post-metadata">

**Author:** ![cmcloud](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/cmcloud/32/32563_2.png) [@cmcloud](https://forums.docker.com/u/cmcloud)\
**Post date:** [October 31, 2021, 9:27am UTC](https://forums.docker.com/t/nextcloud-app-set-up-email-server-doesnt-work/117038/3 "2021-10-31T09:27:01Z")

</div>

> [@rimelek](#):
>
> those spaces at the beginning and at the end of the domain name

I removed the spaces and now it works. Thank you a lot 🙂
