Docker Community Forums

Share and learn in the Docker community.

Nextcloud App - set up email server doesn't work

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 :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 ',
‘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.

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.

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