Email settings does not work after installing nextcloud 14

A problem occurred while sending the email. Please revise your settings. (Error: Connection could not be established with host [ #0] Log data: ++ Starting Swift_SmtpTransport !! Connection could not be established with host [ #0] (code: 0)

When I try to send email from basic settings it gives me this error

Can anyone help?

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2):
Operating system and version (eg, Ubuntu 17.04):
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1):

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N):

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:


The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):


The output of your Apache/nginx/system log in /var/log/____:


Cannot confirm this. Email works fine here. Did you check your email settings?

Yes the settings are correct but yet it is not working. With the same configuration, I can access my email on email clients.

well it would be nice if you could give out some more details about your setup/environment and such… don’t forget to put some logfiles, as well…

Are you using the Sendmail or the SMTP Method? Seems SMTP, looking at your initial report. I just tried both methods and both work. Make sure you select the correct encryption and port settings.