43

Since Gmail implemented multiple sign-on, I have been unable to create a bookmark URL that will always go to my "@gmail.com" inbox. For hosted domains, it's easy enough to make the bookmark URL: https://mail.google.com/a/example.com will always take you to your @example.com inbox. However, this does not work with @gmail.com addresses. I am aware of the https://mail.google.com/mail/u/[number] address form, however this address is dependent on the order in which you signed in to accounts during this browser session, and thus is not an acceptable URL that will always go to the same place.

Is there any URL that will always take me to @gmail.com address, assuming I am logged in to that account?

Javascript bookmarklets would be acceptable, but anything involving a plugin or add-on is not acceptable.

migrated from stackoverflow.com Sep 15 '11 at 17:38

This question came from our site for professional and enthusiast programmers.

  • Looking for the same - were you able to figure this out? – user15654 Dec 18 '11 at 10:21
  • No. I gave up and switched to Chrome where I can use the "Pin tab" feature and at least it isn't as annoying to leave several GMail tabs open. – aocole Jan 16 '12 at 19:37
  • 1
    Joyjit finally found the answer! – aocole Sep 6 '13 at 18:18
33

https://mail.google.com/mail/u/?authuser=user@gmail.com

Seems to work quite fine for me.

  • 3
    This does not work for me. It takes me to the gmail login screen, but the user line is not pre-filled. I think this answer is out of date now. – Mnebuerquo Nov 29 '14 at 13:34
  • 2
    @Mnebuerquo - This answer still works for me. This question assumes that you are already logged in to your account. – aocole Dec 10 '14 at 19:59
  • Excellent, thank you. Seems to work for Google Drive too: drive.google.com/drive/u/?authuser=user@gmail.com – rick Apr 9 '16 at 11:34
  • 1
    Better alternative: drive.google.com/drive/u/user@gmail.com. This has the benefit of adding parameters, such as drive.google.com/drive/u/user@gmail.com/search?q=asdf, useful for custom search queries – espinchi Jul 27 '17 at 12:59
  • This worked for me if you are already logged into the account in question. It also works for google-hosted/google apps accounts with a different domain, eg. authuser=myself@MyCustomDomain.ViaGoogleApps.etc. – Demis Sep 18 '17 at 20:29
13

Yes, once you are logged in, you can simply use your email address instead of the [number] in your URL. For example: https://mail.google.com/mail/u/example@gmail.com; this also works for Google Apps domains.

This also works great to go to a specific email, or filter, or so, with: https://mail.google.com/mail/u/example@gmail.com/#inbox/153d2095719946b

If you are not logged in to your example@gmail.com account yet, but to another account, then the link will not work and show "The conversation that you requested no longer exists."

  • 3
    This should be accepted answer – Dan Aug 25 '18 at 10:59
  • 1
    Works as well as the accepted answer, and has the virtue of being shorter. – Kyralessa Oct 24 '18 at 7:18
  • 1
    This works for me, unlike the accepted answer – Luis Ferrao Oct 25 '18 at 6:50
  • 1
    This also appears to work for third-party GSuite domains (i.e. https://mail.google.com/mail/u/user@university.edu), whereas using https://mail.google.com/mail/u/?authuser=user@university.edu redirects to the default mailbox for me. – alphaleonis Nov 29 '18 at 16:02
9

Combining the information from the other answers with a fair bit of research, I believe this is the best way of referring to a particular GMail account:

https://accounts.google.com/ServiceLogin?service=mail&passive=true&Email=example@domain.com&continue=https://mail.google.com/mail/u/example@domain.com/

This will redirect through accounts.google.com, making the relevant Email address log in if it isn't already logged in, and just select it if it is logged in. (If you remove passive=true, you'll always prompt for password.)

If you want to redirect to a particular fragment under GMail (e.g. to display a particular mail or contact), just URL encode the # as %23 - so add %23inbox/152bc41f0ca2d9bf at the end, like this:

https://accounts.google.com/ServiceLogin?service=mail&passive=true&Email=example@domain.com&continue=https://mail.google.com/mail/u/example@domain.com/%23inbox/152bc41f0ca2d9bf

If what you want to do is create a pre-filled email, use a variant like the following:

https://accounts.google.com/ServiceLogin?service=mail&passive=true&Email=example@domain.com&continue=https://mail.google.com/mail/u/example@domain.com/?view=cm%26fs=1%26to=someone@example.com%26su=SUBJECT%26body=BODY%26bcc=someone.else@example.com

Hat tip to robertwbradford for the parameters for send.

  • any way to pre-fill the password? – Kim Jun 15 '17 at 13:55
  • @Kim No. Absolutely and specifically not. That would be horrific user security. If you need to authorise on behalf of a user, use OAuth2. – Greg Nov 26 '17 at 17:08
  • Any tips on how to get a space into the body? I've tried + and %20 and &nbsp and they all break the link. Thanks for any help. – jaredcohe Jun 18 '18 at 0:34
  • It turns out that you have to use %2B for spaces because those convert into + when the url is processed. – jaredcohe Jun 20 '18 at 14:15
6

Try this out, the below URL seems to be working for me:

https://accounts.google.com/ServiceLoginAuth?continue=http%3A%2F%2Fgmail.google.com%2Fgmail&service=mail&Email=youremail@gmail.com

Though I couldn't pre fill password

  • This works for me. This url does not assume you are already logged in. – Mnebuerquo Dec 19 '14 at 14:28
2

Similarly to how you can form a URL to take you to a particular inbox, you can also form a URL to take you directly to a particular contact in a particular Gmail account like so:

https://mail.google.com/mail/u/?authuser=yourname@gmail.com&?shva=1#contact/0123456789ABCDEF

Where 0123456789ABCDEF is the unique 16 character contact ID within that account.

After the ?authuser you include the &?shva=#1contact/ takes you the contact list for that user. You must include both characters &?.

This works regardless of how many Gmail accounts you are simultaneously logged into and regardless of login order. The ?authuser replaces the 0, 1, 2, etc. that Gmail typically substitutes.

-1

I found a working version using this
https://mail.google.com/mail/u/1/#inbox
https://mail.google.com/mail/u/2/#inbox
..etc. to switch between email addresses. First time to need to login with password.

  • Downvoted, sorry, this is not valid. The OP specifically said the u/n index changes depending on the order in which you logged into each account. – TonyG Jan 14 '18 at 20:18
  • The OP said in his question "I am aware of the mail.google.com/mail/u/[number] address form, however this address is dependent on the order in which you signed in to accounts during this browser session, and thus is not an acceptable URL that will always go to the same place." – Kyralessa Oct 24 '18 at 7:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.