# Google SMTP for the email

**URL:** <https://forums.rocket.chat/t/google-smtp-for-the-email/11075>\
**Category:** Community Support\
**Created:** [April 29, 2021, 7:28pm UTC](https://forums.rocket.chat/t/google-smtp-for-the-email/11075 "2021-04-29T19:28:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![carloshell](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@carloshell](https://forums.rocket.chat/u/carloshell)\
**Post date:** [April 29, 2021, 7:28pm UTC](https://forums.rocket.chat/t/google-smtp-for-the-email/11075/1 "2021-04-29T19:28:38Z")

</div>

### Description

I am unable to setup the email SMTP via Google domain. I did remove 2FA and enable pop3 and imap in the gmail settings. I also enable the settings for unauthorized app auth in the google admin console.  
Everything seems to be working fine, but it doesnt send any emails at all.

### Server Setup Information

Rocket.Chat Version: 3.13.2  
NodeJS Version: 12.21.0 - x64  
MongoDB Version: 3.6.14  
MongoDB Engine: wiredTiger  
Platform: linux  
Process Port: 3000  
Site URL: hidden 🙂  
=ReplicaSet OpLog: Enabled  
Commit Hash: 5e9f4bc424  
Commit Branch: HEAD

### Any additional Information

Logs:  
I20210429-15:21:42.127(-4) Updating process.env.MAIL\_URL  
I20210429-15:21:44.542(-4) The $MAIL\_URL is ‘smtp://…:465’. You probably want ‘smtps://’ (The ‘s’ enables TLS/SSL) since ‘465’ is typically a secure port. undefined

Also these are my smtp settings:

Protocol: smtp  
Host: [smtp.gmail.com](http://smtp.gmail.com)  
Ignore TLS and pool activated  
port: 465  
username: the entire email with @  
Password: same as gmail  
From Email: Not sure, I put admin@csbtech.ca, that section was a bit confusing.

---

<div class="post-metadata">

**Author:** ![john.crisp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/john.crisp/32/2711_2.png) [@john.crisp](https://forums.rocket.chat/u/john.crisp)\
**Post date:** [April 30, 2021, 10:02am UTC](https://forums.rocket.chat/t/google-smtp-for-the-email/11075/2 "2021-04-30T10:02:01Z")

</div>

You will need secured Email for Gmail - smtps

So either port 465 or 587 with ignore TLS False

Username is you Google username, and your email is the actual email From address

So you might be [joe.blogs@gmail.com](mailto:joe.blogs@gmail.com)

You can actually login to Google as ‘joe.blogs’ but your From address will be ‘joe.blogs@gmail.com’

---

<div class="post-metadata">

**Author:** ![beenmeckel](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@beenmeckel](https://forums.rocket.chat/u/beenmeckel)\
**Post date:** [May 31, 2021, 3:50pm UTC](https://forums.rocket.chat/t/google-smtp-for-the-email/11075/3 "2021-05-31T15:50:06Z")

</div>

Couldn’t you get around this by setting up an SMTP server inside your network that does outbound TLS to Google? I suppose you could put it in your approved senders list.

---

<div class="post-metadata">

**Author:** ![john.crisp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/john.crisp/32/2711_2.png) [@john.crisp](https://forums.rocket.chat/u/john.crisp)\
**Post date:** [June 1, 2021, 10:19am UTC](https://forums.rocket.chat/t/google-smtp-for-the-email/11075/4 "2021-06-01T10:19:08Z")

</div>

A good alternative, but running your own mail server securely, and without it getting blocked by Google, is not for the faint hearted!

---

<div class="post-metadata">

**Author:** ![acirep](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@acirep](https://forums.rocket.chat/u/acirep)\
**Post date:** [January 7, 2023, 10:52am UTC](https://forums.rocket.chat/t/google-smtp-for-the-email/11075/6 "2023-01-07T10:52:07Z")

</div>

@john.crisp I did exactly what you suggested and it does not work.

Protocol: smpts  
Host: [smtp.google.com](http://smtp.google.com)  
Username: username without @  
Password: same as gmail  
From email: username and @ to create full email  
Ignore TLS: not active (false)

If I select port 587 then I see this in logs

```auto
Exception in defer callback: [Error: 140039672534912:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:] { library: 'SSL routines', function: 'ssl3_get_record', reason: 'wrong version number', code: 'ESOCKET', command: 'CONN' } 

```

If I select port 465 with same other settings I see this in logs

```auto
Exception in defer callback: Error: Invalid login: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials q6-20020a05600c46c600b003d1f3e9df3csm10125399wmo.7 - gsmtp at SMTPConnection._formatError (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:784:19) at SMTPConnection._actionAUTHComplete (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:1536:34) at SMTPConnection.<anonymous> (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:540:26) at SMTPConnection._processResponse (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:947:20) at SMTPConnection._onData (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:749:14) at TLSSocket.SMTPConnection._onSocketData (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:189:44) at TLSSocket.emit (events.js:400:28) at TLSSocket.emit (domain.js:475:12) at addChunk (internal/streams/readable.js:293:12) at readableAddChunk (internal/streams/readable.js:267:9) at TLSSocket.Readable.push (internal/streams/readable.js:206:10) at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23) at TLSWrap.callbackTrampoline (internal/async_hooks.js:130:17) { code: 'EAUTH', response: '535-5.7.8 Username and Password not accepted. Learn more at<br>' + '535 5.7.8 https://support.google.com/mail/?p=BadCredentials q6-20020a05600c46c600b003d1f3e9df3csm10125399wmo.7 - gsmtp', responseCode: 535, command: 'AUTH PLAIN' } 

```

Any suggestion or hint i highly appreciated!

---

<div class="post-metadata">

**Author:** ![Jamie\_Pate](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/jamie_pate/32/4692_2.png) [@Jamie\_Pate](https://forums.rocket.chat/u/Jamie_Pate)\
**Post date:** [May 29, 2023, 8:58pm UTC](https://forums.rocket.chat/t/google-smtp-for-the-email/11075/7 "2023-05-29T20:58:53Z")

</div>

You may need to create an ‘app’ password if you have 2fa, this url is printed in my logs

`https://support.google.com/mail/answer/7126229?visit_id=638209902576437704-2869235916&p=BadCredentials&rd=2#cantsignin&zippy=%2Ci-cant-sign-in-to-my-email-client`

Unfortunately I don’t have 2fa enabled. and get the same `ssl3_get_record` wrong version number error for port 587

---

<div class="post-metadata">

**Author:** ![Vladislav](https://avatars.discourse-cdn.com/v4/letter/v/bbce88/32.png) [@Vladislav](https://forums.rocket.chat/u/Vladislav)\
**Post date:** [January 21, 2024, 8:58pm UTC](https://forums.rocket.chat/t/google-smtp-for-the-email/11075/8 "2024-01-21T20:58:46Z")

</div>

Hi there! Here to share my success in SMTP setup with google account with 2Fa enabled:  
=================================================\*  
Protocol: smtp  
Host: [smtp.gmail.com](http://smtp.gmail.com)  
Port: 587  
IgnoreTLS: off  
Pool: on  
Login: \*\*\*\*\*\*\*\*\*\*@gmail.com (your google email)  
_Password: \*\*\*\* \*\*\*\* \*\*\*\* \*\*\*\* (here paste password for app_)  
EmaiL: \*\*\*\*\*\*\*\*\*\*@gmail.com (same as login)  
\*=================================================  
To obtain pass for app go to google account management - Security - 2-Step Verification - App passwords

---

<div class="post-metadata">

**Author:** ![Mondoshawan](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/mondoshawan/32/5493_2.png) [@Mondoshawan](https://forums.rocket.chat/u/Mondoshawan)\
**Post date:** [August 22, 2024, 2:02am UTC](https://forums.rocket.chat/t/google-smtp-for-the-email/11075/9 "2024-08-22T02:02:56Z")

</div>

Hi all. 8/21/2024 and I’m successfully using a secure (smtps) variation of Vladislav’s solution above. To reiterate, you need to enable 2FA on the Google account in order to create an app password for the RocketChat mailer, which you’ll use as the password, below:

Protocol: smtps  
Host: [smtp.gmail.com](http://smtp.gmail.com)  
Port: 465  
IgnoreTLS: off (forced off by choice of smtps protocol)  
Pool: off  
Username: [Username@GoogleWorkspaceDomain.com](mailto:Username@GoogleWorkspaceDomain.com) (your google email address)  
Password: \*\*\*\* \*\*\*\* \*\*\*\* \*\*\*\* (Google App password)  
From Email: (same as Username)
