# Gmail SMTP Email Server config

**URL:** <https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126>\
**Category:** ℹ️ Support\
**Tags:** github\_issue\_exists, nc13\
**Created:** [June 19, 2018, 9:05am UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126 "2018-06-19T09:05:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dedero](https://help.nextcloud.com/letter_avatar/dedero/32/5_5575768a8748004e209b776fc1b2916d.png) [@dedero](https://help.nextcloud.com/u/dedero)\
**Post date:** [June 19, 2018, 9:05am UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/1 "2018-06-19T09:05:36Z")

</div>

Hello All,

I’m trying to configure the Email server using Gmail under Admin console in Nextcloud 13 but it doesn’t work and the logs are not showing anything:

I’m using the supposed correct Gmail IMAP/SMTP configuration but no luck: [Check Gmail through other email platforms - Gmail Help](https://support.google.com/mail/answer/7126229?hl=en)

And there is no clear error output _“From address” and “Credentials” field are blanked but I’m using my actual e-mail address to login_:

 ![image](https://help.nextcloud.com/uploads/default/original/2X/6/643511f50cad9401a27ac4f456cafce179e8db09.png)

I’m also using the Administration manual configuration as guideline: [https://docs.nextcloud.com/server/13/admin\_manual/configuration\_server/email\_configuration.html](https://docs.nextcloud.com/server/13/admin_manual/configuration_server/email_configuration.html)

Any ideas here or any other way to check the logs further?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [June 19, 2018, 10:28am UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/2 "2018-06-19T10:28:24Z")

</div>

- ssl/tls connections via [smpt.gmail.com](http://smpt.gmail.com) should use port 587, did u try this one as well?
- plus: have you granted access to use imap/pop to your gmailbox in your gmail-account?

aww and why not trying use the search-function in our nice forum first? --\> [Unable to connect to Gmail](https://help.nextcloud.com/t/unable-to-connect-to-gmail/7255)

---

<div class="post-metadata">

**Author:** ![dedero](https://help.nextcloud.com/letter_avatar/dedero/32/5_5575768a8748004e209b776fc1b2916d.png) [@dedero](https://help.nextcloud.com/u/dedero)\
**Post date:** [June 19, 2018, 11:00am UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/3 "2018-06-19T11:00:56Z")

</div>

Hi, thanks for your reply.

As you don’t know me I would like to give some details about me. Being a very active forum user in many different topics, not only for asking but also posting experiences from trips, car maintenance, photography, etc… now being a frequent reader for almost 1 year now, I’m not a post creator due to the very useful search function on this nice forum, so as I didn’t find my actual issue, I decided to post.

I understand that many people just post in forums without even saying hello, introduction or searching but I don’t really see the need of being ironic or sarcastic replying a topic which have not been iniciated in a rude or unrespectful way.

So after my disclaimer, I will answer your suggestions:

- Yes, I already tested (before my post) the 587 and it shows the same error message
- Yes, I granted access to use imap to my gmail account, I actually did it for the “mail” Nextcloud app and it works and still working fine
- replying to your unnecesary ironic question, I found that post you are linking but it didn’t help, I tried everything shown there and the thing is that post is orientated when the mail app Nextcloud client is not working and is not my case, in my case the “email server” function is not working.

Thanks and cheers,  
Bruno

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [June 19, 2018, 11:47am UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/4 "2018-06-19T11:47:17Z")

</div>

> [@dedero](#):
>
> I’m not a post creator due to the very useful search function on this nice forum, so as I didn’t find my actual issue,

hey bruno,  
pls don’t be too pissed as i am going to apologize for having threatening you with wrong suspects. it wasn’t my intention to make you mad. from my viewpoint a majority of ppl isnt really using this search- function. so please take my honest excuses for having thought bad of you.

and i wan’t ironic or even less sarcastic with you… i was just trying to make a small remark about using the search-function, tongue-in-cheek 😉

i spare you with questions like: did you try port 587 using starttls from the dropdown… as i’m sure now you have played through all possibilities.

i have 2 more hints for you:

- pls make sure that your provider (of your server) isn’t blocking port 587
- i hope it’s not related to self-signed (or wrong signed) ssl-certificates.

good luck  
jimmy

---

<div class="post-metadata">

**Author:** ![dedero](https://help.nextcloud.com/letter_avatar/dedero/32/5_5575768a8748004e209b776fc1b2916d.png) [@dedero](https://help.nextcloud.com/u/dedero)\
**Post date:** [June 19, 2018, 1:29pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/5 "2018-06-19T13:29:58Z")

</div>

Hi Jimmy, thanks for clarifying, I totally understand your approach because some users can be annoying. I just wanted to clarify my point of view and which kind of forum user I am.

- Yes, I also tried using port 587 using STARTTLS from the dropdown
- The ISP thing it’s a good point, but I guess it doesn’t because I can use the mail app connected to gmail and I use SMTP and IMAP in there unless the mail app connects to gmail in any other way, for example this is my mail configuration (I mean the app) which works fine, and I’m trying to configure the same account for the admin mail:  
 ![image](https://help.nextcloud.com/uploads/default/original/2X/f/fb1a7c6b71aba3c228fdfbba1b1a80cba1147669.png)

While I was writing this reply it came to my mind whether using the same account for the mail app and the admin mail could make some conflict between them (even though it shouldn’t) so I removed that account from the mail app and still not working showing the same error message

- I didn’t fully get the certificate part, you mean for the domain that I’m actually using for the my Nextcloud?, if so, I’m not using a self-signed certificate, I’m actually using one from Let’s encrypt.

Thanks and cheers,  
Bruno.

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [June 19, 2018, 1:52pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/6 "2018-06-19T13:52:12Z")

</div>

so this is getting tricky now…

am i right and you have installed your sever with an ISP?

basically, google is smart and treats logins from different geographical locations with different security restrictions (blocks)… so this could be another reason  
so there was big hint on the net that you can “unlock” or re-auth your google account with the following url:  
`https://accounts.google.com/UnlockCaptcha`  
and of course you should do that from your ISP

hope that’s gonna work for you, now

---

<div class="post-metadata">

**Author:** ![dedero](https://help.nextcloud.com/letter_avatar/dedero/32/5_5575768a8748004e209b776fc1b2916d.png) [@dedero](https://help.nextcloud.com/u/dedero)\
**Post date:** [June 19, 2018, 2:18pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/7 "2018-06-19T14:18:07Z")

</div>

Actually not, I mean with ISP my internet provider (Vodafone DSL) and I have installed my nextcloud locally at home.

Thanks for the UnlockCaptcha url, I used it before but I didn’t remeber to try now with that, but I tried with no luck

I found something interesting in the nextcloud.log (I assume my fault for not looking at in the very begining and I feel like “did you check if the pc is plugged in the power socket?”)

It seems there is some certificate validation error as you mentioned before but I’m still looking in google what does it means but I need to look deeper:

{“reqId”:“j0M8HXBraQ0siCsLWWXB”,“level”:3,“time”:“2018-06-19T16:10:19+02:00”,“remoteAddr”:“XXX.XXX.XXX.XXX”,“user”:“XXXXXX”,“app”:“PHP”,“method”:“POST”,“url”:"/settings/admin/mailtest",**“message”:"stream\_socket\_enable\_crypto(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1416F086:SSL routines:tls\_process\_server\_certificate:certificate verify failed at /var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php**#94",“userAgent”:“Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36”,“version”:“13.0.4.0”}

Any ideas??

Thanks and cheers,  
Bruno.

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [June 19, 2018, 2:26pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/8 "2018-06-19T14:26:33Z")

</div>

do you run ipv6 and ipv4 at the same time? or even only ipv4?

anyways… try pinging [smtp.gmail.com](http://smtp.gmail.com) for it’s ip-adress and use it on your setup. or use the url given in the answer… maybe that helps

---

<div class="post-metadata">

**Author:** ![Nemskiller](https://help.nextcloud.com/user_avatar/help.nextcloud.com/nemskiller/32/875_2.png) [@Nemskiller](https://help.nextcloud.com/u/Nemskiller)\
**Post date:** [June 19, 2018, 2:31pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/9 "2018-06-19T14:31:27Z")

</div>

it got harder to get gmail as a smtp now because of security reasons,  
You have to go to [gmail.com](http://gmail.com) and allow third party apps to allow connection to your account, or to create app password.  
Gmail prefer in order first 465 then 578 for SMTPS port

---

<div class="post-metadata">

**Author:** ![dedero](https://help.nextcloud.com/letter_avatar/dedero/32/5_5575768a8748004e209b776fc1b2916d.png) [@dedero](https://help.nextcloud.com/u/dedero)\
**Post date:** [June 19, 2018, 2:37pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/10 "2018-06-19T14:37:20Z")

</div>

@JimmyKater I’m actually using ipv4 only, I tried also with the ip address and no luck…

@Nemskiller thanks for the info… it seems I need to find some other email provider with less security restrictions. Actually I created an apps password before deactivating 2fa auth for testing but now with no 2fa activated doesn’t work either… quite strange

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [June 19, 2018, 3:03pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/11 "2018-06-19T15:03:39Z")

</div>

> [@dedero](#):
>
> it seems I need to find some other email provider with less security restrictions

well… web and gmx work flawlessly

---

<div class="post-metadata">

**Author:** ![Nemskiller](https://help.nextcloud.com/user_avatar/help.nextcloud.com/nemskiller/32/875_2.png) [@Nemskiller](https://help.nextcloud.com/u/Nemskiller)\
**Post date:** [June 19, 2018, 3:12pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/12 "2018-06-19T15:12:51Z")

</div>

I’ve tested [Outlook.com](http://Outlook.com) (Microsoft) without problems too,

Gmail worked well some years before, but it’s a hard way to make it work now. The security settings change all the time…

At the moment i have one client who works with that.

---

<div class="post-metadata">

**Author:** ![dedero](https://help.nextcloud.com/letter_avatar/dedero/32/5_5575768a8748004e209b776fc1b2916d.png) [@dedero](https://help.nextcloud.com/u/dedero)\
**Post date:** [June 19, 2018, 7:02pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/13 "2018-06-19T19:02:52Z")

</div>

I tried using [web.de](http://web.de) smtp server and still showing the same certificate error as for gmail! 😤

I will dig a bit on google and post any result if any…

thanks for your help!

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [June 19, 2018, 8:20pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/14 "2018-06-19T20:20:40Z")

</div>

one last question… the email setup is for admins, right? have you put a valid emailadress at your (normal) users email?

---

<div class="post-metadata">

**Author:** ![Nemskiller](https://help.nextcloud.com/user_avatar/help.nextcloud.com/nemskiller/32/875_2.png) [@Nemskiller](https://help.nextcloud.com/u/Nemskiller)\
**Post date:** [June 19, 2018, 9:42pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/15 "2018-06-19T21:42:24Z")

</div>

Another question does your serveur have the good date/time ?

---

<div class="post-metadata">

**Author:** ![MeiRos](https://help.nextcloud.com/user_avatar/help.nextcloud.com/meiros/32/8211_2.png) [@MeiRos](https://help.nextcloud.com/u/MeiRos)\
**Post date:** [June 19, 2018, 11:08pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/16 "2018-06-19T23:08:50Z")

</div>

Is your problem related to this?  
[https://github.com/nextcloud/server/issues/7421](https://github.com/nextcloud/server/issues/7421)

---

<div class="post-metadata">

**Author:** ![dedero](https://help.nextcloud.com/letter_avatar/dedero/32/5_5575768a8748004e209b776fc1b2916d.png) [@dedero](https://help.nextcloud.com/u/dedero)\
**Post date:** [June 20, 2018, 8:24am UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/17 "2018-06-20T08:24:56Z")

</div>

@JimmyKater yes correct, I want to configure it for admin messages like password reset and I want also activate registration  
@Nemskiller yes, I have the NTP server from Germany configured  
@MeiRos actually yes, thanks for the info, I was taking a look at that post yesterday as well so it seems my problem is due to I have installed PHP 7.1 instead of 7.2, it seems in 7.2 this issue is solved and also will be solved in Nextcloud 14. The solution there which states hardcoding the usage of TLS 1.2 in swiftmailer (/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php) doesn’t work in my case…

During my Nextcloud 13 implementation I decided to install PHP 7.1 because 7.2 didn’t have a fully working php-smbclient at that moment but now the impact is in the mails delivery 😩 , I would need to see whether is easier to upgrade to 7.2 or wait for NC14

Thank you all for your help 👍

---

<div class="post-metadata">

**Author:** ![dedero](https://help.nextcloud.com/letter_avatar/dedero/32/5_5575768a8748004e209b776fc1b2916d.png) [@dedero](https://help.nextcloud.com/u/dedero)\
**Post date:** [June 20, 2018, 11:47am UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/18 "2018-06-20T11:47:42Z")

</div>

OK, more news… but no solution

- updated PHP to 7.2 keeping the original swiftmailer configuration --\> still doesn’t work
- updated PHP to 7.2 forcing swiftmailer to use TLS 1.2 --\> still doesn’t work
- both above situations are being tested not only with a gmail account but also with a [web.de](http://web.de) mail account

I’m lost in the universe now, no idea what else to do… just waiting until NC14 is going to be launched

Cheers,  
Bruno.

---

<div class="post-metadata">

**Author:** ![alfred](https://help.nextcloud.com/letter_avatar/alfred/32/5_5575768a8748004e209b776fc1b2916d.png) [@alfred](https://help.nextcloud.com/u/alfred)\
**Post date:** [June 20, 2018, 1:57pm UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/19 "2018-06-20T13:57:25Z")

</div>

Not a great solution but in the meantime you could set up a Postfix mail relay as a workaround.

---

<div class="post-metadata">

**Author:** ![gerardorourke](https://help.nextcloud.com/letter_avatar/gerardorourke/32/5_5575768a8748004e209b776fc1b2916d.png) [@gerardorourke](https://help.nextcloud.com/u/gerardorourke)\
**Post date:** [January 30, 2019, 8:27am UTC](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126/20 "2019-01-30T08:27:52Z")

</div>

Have you made sure the GMAIL account has been enabled to allow “less secure apps”  
[https://support.google.com/accounts/answer/6010255?hl=en](https://support.google.com/accounts/answer/6010255?hl=en)

Gerard

[Next page](https://help.nextcloud.com/t/gmail-smtp-email-server-config/33126.md?page=2)
