# Gmail SMTP Config

**URL:** <https://help.nextcloud.com/t/gmail-smtp-config/152846>\
**Category:** ℹ️ Support\
**Tags:** mail\
**Created:** [January 2, 2023, 12:29pm UTC](https://help.nextcloud.com/t/gmail-smtp-config/152846 "2023-01-02T12:29:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EdoubleDee](https://help.nextcloud.com/letter_avatar/edoubledee/32/6_449c533f586939b6e5f246632a46421f.png) [@EdoubleDee](https://help.nextcloud.com/u/EdoubleDee)\
**Post date:** [January 2, 2023, 12:29pm UTC](https://help.nextcloud.com/t/gmail-smtp-config/152846/1 "2023-01-02T12:29:53Z")

</div>

Dear Community,

My gmail SMTP config was working fine for a long while, but after I purged all my app passwords I can’t get it to work anymore. I recreated an app password for my Nextcloud instance, but it won’t connect to the server over port 465 or 587 (same error). Is there someone here who has this operational?

 ![1](https://help.nextcloud.com/uploads/default/original/3X/8/8/8854184d72507cc5c85011b1c2e3c87aba9a54c2.png)

Kind regards,  
Erik

---

<div class="post-metadata">

**Author:** ![devnull](https://help.nextcloud.com/user_avatar/help.nextcloud.com/devnull/32/27793_2.png) [@devnull](https://help.nextcloud.com/u/devnull)\
**Post date:** [January 2, 2023, 1:33pm UTC](https://help.nextcloud.com/t/gmail-smtp-config/152846/2 "2023-01-02T13:33:22Z")

</div>

I do not use Google Mail. But maybe you can use **TLS/SSL** instead of **STARTTLS**.  
Also you can test port **587** instead of **465**.

---

<div class="post-metadata">

**Author:** ![EdoubleDee](https://help.nextcloud.com/letter_avatar/edoubledee/32/6_449c533f586939b6e5f246632a46421f.png) [@EdoubleDee](https://help.nextcloud.com/u/EdoubleDee)\
**Post date:** [January 2, 2023, 2:35pm UTC](https://help.nextcloud.com/t/gmail-smtp-config/152846/3 "2023-01-02T14:35:33Z")

</div>

Thanks for the reply, I did test that port with the same result.

---

<div class="post-metadata">

**Author:** ![ligal](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ligal/32/46100_2.png) [@ligal](https://help.nextcloud.com/u/ligal)\
**Post date:** [January 2, 2023, 5:51pm UTC](https://help.nextcloud.com/t/gmail-smtp-config/152846/4 "2023-01-02T17:51:36Z")

</div>

Hi,

I’ve already seen the same problem some time ago.  
The solution was to modify the password “hardcoded” on the config.php file. The password on the mail app page seems to not be directly linked to it.

[https://docs.nextcloud.com/server/latest/admin\_manual/configuration\_server/config\_sample\_php\_parameters.html#mail-parameters](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#mail-parameters)

---

<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 14, 2024, 2:22pm UTC](https://help.nextcloud.com/t/gmail-smtp-config/152846/5 "2024-12-14T14:22:04Z")

</div>


