# Nextcloud email settings problem

**URL:** <https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671>\
**Category:** ℹ️ Support\
**Created:** [September 28, 2016, 9:09am UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671 "2016-09-28T09:09:45Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![janar](https://help.nextcloud.com/user_avatar/help.nextcloud.com/janar/32/1339_2.png) [@janar](https://help.nextcloud.com/u/janar)\
**Post date:** [September 28, 2016, 9:09am UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/1 "2016-09-28T09:09:45Z")

</div>

Hei,  
i tryng nextcloud first time.  
I have one problem with email settings ( smtp )  
When i fill the necessary fields ( all mail settings are correct ), then tryng to send test mail.  
I get this error message:

**A problem occurred while sending the email. Please revise your settings. (Error: Connection could not be established with host myhostname [#0])**

Nextcloud log sayng this error:  
**[authz\_core:error] [pid 4725] [client IPaddress:56668] AH01630: client denied by server configuration: /var/www/nextcloud/data/htaccesstest.txt**

**Server configuration:**  
**ubuntu server 14.04.5**  
**Apache version 2.4**  
**PHP 7.0**  
**Nextcloud version 10.0**

I would be very thankful if i find the solution to the problem.  
have a nice day 🙂

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/5_5575768a8748004e209b776fc1b2916d.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [October 1, 2016, 9:25am UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/2 "2016-10-01T09:25:53Z")

</div>

Can you put this in your config/config.php in order to get more details in your logs:

```
/**
 * Enable SMTP class debugging.
 */

'mail_smtpdebug' => true,

```

If you control the mail server as well, you can check the logfiles there as well.

---

<div class="post-metadata">

**Author:** ![janar](https://help.nextcloud.com/user_avatar/help.nextcloud.com/janar/32/1339_2.png) [@janar](https://help.nextcloud.com/u/janar)\
**Post date:** [October 1, 2016, 9:50am UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/3 "2016-10-01T09:50:13Z")

</div>

Hei,  
i add ‘mail\_smtpdebug’ =\> true, in my config.php.  
Where i see more information?  
I see my apache site log /var/www/apache2/pilv\_error.log and /var/www/apache2/error.log  
Admin panel see same error log:  
A problem occurred while sending the email. Please revise your settings. (Error: Connection could not be established with host [mail.addit.ee](http://mail.addit.ee) [#0])

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/5_5575768a8748004e209b776fc1b2916d.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [October 1, 2016, 9:55am UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/4 "2016-10-01T09:55:42Z")

</div>

Are you sending through php? Or smtp?  
The new log-option should create entries in your Nextcloud-logfile.

---

<div class="post-metadata">

**Author:** ![janar](https://help.nextcloud.com/user_avatar/help.nextcloud.com/janar/32/1339_2.png) [@janar](https://help.nextcloud.com/u/janar)\
**Post date:** [October 1, 2016, 9:56am UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/5 "2016-10-01T09:56:53Z")

</div>

Hei,  
i send mail over smtp.  
I see my mailserver this error:  
warning: TLS library problem: error:14094418:SSL routines:SSL3\_READ\_BYTES:tlsv1 alert unknown ca:s3\_pkt.c:1263:SSL alert number 48

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/5_5575768a8748004e209b776fc1b2916d.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [October 1, 2016, 10:18am UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/6 "2016-10-01T10:18:12Z")

</div>

there seems to be a problem with the certificate:  
[https://ssl-tools.net/mailservers/addit.ee](https://ssl-tools.net/mailservers/addit.ee)

---

<div class="post-metadata">

**Author:** ![janar](https://help.nextcloud.com/user_avatar/help.nextcloud.com/janar/32/1339_2.png) [@janar](https://help.nextcloud.com/u/janar)\
**Post date:** [October 1, 2016, 11:05am UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/7 "2016-10-01T11:05:05Z")

</div>

Hey,  
Thank you, i found solution 🙂

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/5_5575768a8748004e209b776fc1b2916d.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [October 1, 2016, 11:21am UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/8 "2016-10-01T11:21:54Z")

</div>

> [@janar](#):
>
> Thank you, i found solution

Would be nice to let others know what your solution was.

---

<div class="post-metadata">

**Author:** ![janar](https://help.nextcloud.com/user_avatar/help.nextcloud.com/janar/32/1339_2.png) [@janar](https://help.nextcloud.com/u/janar)\
**Post date:** [October 1, 2016, 11:44am UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/9 "2016-10-01T11:44:01Z")

</div>

Hei,  
my solution are here:

i add my postfix conf my CA cert file.  
ubuntu server 16.04 location /etc/postfix/main.cf  
And i add this line in TLS parameters:

TLS parameters  
smtpd\_tls\_CAfile = /etc/ssl/certs/CAfile.crt

its worked for me 🙂

---

<div class="post-metadata">

**Author:** ![cracker0dks](https://help.nextcloud.com/user_avatar/help.nextcloud.com/cracker0dks/32/3540_2.png) [@cracker0dks](https://help.nextcloud.com/u/cracker0dks)\
**Post date:** [January 14, 2019, 8:22pm UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/10 "2019-01-14T20:22:16Z")

</div>

I was using the cert.pem instead of the fullchain.pem (From letsencrypt) on my mailserver and got this error. You can check your emailserver here: [www.sslshopper.com](https://www.sslshopper.com/ssl-checker.html#hostname=smtp.gmail.com:465)

Working without problem using the fullchain.pem

---

<div class="post-metadata">

**Author:** ![Zakkob](https://help.nextcloud.com/user_avatar/help.nextcloud.com/zakkob/32/17233_2.png) [@Zakkob](https://help.nextcloud.com/u/Zakkob)\
**Post date:** [October 5, 2019, 10:35pm UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/11 "2019-10-05T22:35:51Z")

</div>

For those who would like to use [smtp.gmail.com](http://smtp.gmail.com) (after setting at [myaccount.google.com](http://myaccount.google.com) ), port 587 did not work but port 465 worked when “Encryption: SSL/TLS” is chosen at “Email server” setting of Nextcloud.

In fact, [www.sslshopper.com/ssl-checker.html#hostname=smtp.gmail.com:587](http://www.sslshopper.com/ssl-checker.html#hostname=smtp.gmail.com:587) showed “No SSL”, but 465 displayed its certificate info.

---

<div class="post-metadata">

**Author:** ![zentrix](https://help.nextcloud.com/letter_avatar/zentrix/32/5_5575768a8748004e209b776fc1b2916d.png) [@zentrix](https://help.nextcloud.com/u/zentrix)\
**Post date:** [July 29, 2021, 12:57pm UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/12 "2021-07-29T12:57:20Z")

</div>

Hi, I also simply changed port to 465 and it is working, can someone explan maybe? Thanks

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [November 6, 2024, 8:54pm UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/13 "2024-11-06T20:54:39Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 3:25pm UTC](https://help.nextcloud.com/t/nextcloud-email-settings-problem/3671/14 "2024-12-04T15:25:53Z")

</div>


