URL to compose a message in Gmail (with full Gmail interface and specified to, bcc, subject, etc.)

HyperlinkGmailGoogle Apps

Hyperlink Problem Overview


I found a post that provides an example for a link which opens just a compose message window. However, I would like it to open a window with the full Gmail interface but ready to compose a new message.

Of course this works:

https://mail.google.com/mail/u/0/#compose

But, I would also like to add a subject, to, bcc, etc. I tried something like the following, but to no avail:

https://mail.google.com/mail/[email protected]&[email protected]&subject=Hey#compose

Any ideas? Thanks.

Hyperlink Solutions


Solution 1 - Hyperlink

Solution 2 - Hyperlink

Bookmarking this URL should give you a full-screen compose window, without any distractions:

https://mail.google.com/mail/?view=cm&fs=1&tf=1

Additionally, if you want to be future-proof (see for instance how other URLs in this question stopped working) you can bookmark a link to:

mailto:

It will open your default email client and you probably already have Gmail configured for that purpose.

Solution 3 - Hyperlink

The GMail web client supports mailto: links

For regular @gmail.com accounts: https://mail.google.com/mail/?extsrc=mailto&url=...

For G Suite accounts on domain gsuitedomain.com: https://mail.google.com/a/gsuitedomain.com/mail/?extsrc=mailto&url=...

... needs to be replaced with a urlencoded mailto: link.

Demo: https://mail.google.com/mail/?extsrc=mailto&url=mailto%3A%3Fto%3Dsomeguy%40gmail.com%26bcc%3Dmyattorney%40gmail.com%2Cbuzzfeed%40gmail.com%26subject%3DHi%2520There%26body%3Dbody%2520goes%2520here

Learn more about mailto: links by reading RFC6068

Solution 4 - Hyperlink

It's worth pointing out that if you have multiple Gmail accounts, you may want to use the URL approach because you can customize which account to compose from.

e.g.

https://mail.google.com/mail/u/0/#inbox?compose=new   
https://mail.google.com/mail/u/1/#inbox?compose=new

Or if you know the email address you are sending from, replace the numeric index with the email address:

https://mail.google.com/mail/u/your@email.com/#inbox?compose=new

Solution 5 - Hyperlink

I thought I'd try and consolidate the information from several good answers and comments and provide some additional information. Examples first then background and explanation of terminology below.

N.B. All links will fall back to the default account if there is no match

Opens the inbox with a compose window in the bottom right

  • Default account:
    https://mail.google.com/mail/#compose
  • Specific account by index (second in this example):
    https://mail.google.com/mail/u/1/#compose
  • Specific account by email address ([email protected] in this example):
    https://mail.google.com/mail/u/[email protected]/#compose
  • Any account from specific domain (example.edu in this example):
    https://mail.google.com/a/example.edu/mail/#compose
  • From specific delegated mailbox (id abcd1234efgh5678 in this example):
    https://mail.google.com/mail/d/abcd1234efgh5678/#compose
  • From specific delegated mailbox belonging to non-default account (id 1234efgh5678ijkl, fourth user):
    https://mail.google.com/mail/u/3/d/1234efgh5678ijkl/#compose

Each example above automatically redirects from #compose to #inbox?compose=new. You can use either URL.

Include a to address, subject, body, cc and bcc by opening the Compose Message (cm) view directly. This opens the compose message view fullscreen (even without fs=1 parameter). May struggle with some special characters in the URL.

Anything you can put in a mailto: link can be passed to Gmail. You need to URL encode* the mailto link first. This takes care of accented letters and other special characters that URLs can choke on:

mailto:[email protected]?subject=SUBJECT&body=BODY&[email protected]
  v  v  v  v  v  v 
mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
  • Default account:
    https://mail.google.com/mail/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
  • Specific account by index (second in this example):
    https://mail.google.com/mail/u/1/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
  • Specific account by email address ([email protected] in this example):
    https://mail.google.com/mail/u/[email protected]/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
  • Any account from specific domain (example.edu in this example):
    https://mail.google.com/a/example.edu/mail/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
  • From specific delegated mailbox (id abcd1234efgh5678 in this example):
    https://mail.google.com/mail/d/abcd1234efgh5678/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
  • From specific delegated mailbox belonging to non-default account (id 1234efgh5678ijkl, fourth user):
    https://mail.google.com/mail/u/3/d/1234efgh5678ijkl/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com

*More information on URL Encoding / Percent Encoding on Wikipedia. At the time of writing, urlencoder.io allows you to encode online and also has links to blog articles on how to URL Encode using a few common languages.

Background and Definitions
  • You can log in to multiple Gmail and/or Google Workspace accounts.

  • The first account you log into in a fresh browser becomes your default account.

  • The default account can vary for you if you use different browsers or browser profiles. It can also change if you sign out, remove all accounts and sign back in in a different order.

  • If you sign in to multiple accounts they are indexed in order of sign in. The default account has an index of zero. Navigating to https://mail.google.com/mail/#inbox will usually redirect you to your default account (index zero) if you are signed in to more than one account: https://mail.google.com/mail/u/0/#inbox

  • You can specify a Google Workspace domain by inserting /a/<domain> before /mail (whereas user index /u/<index> goes after /mail). This can be useful when you are providing a link internally in a company and you want the link to compose a new email in their work account (regardless of what order they signed in to their various accounts with)

  • You can compose a message from a delegated mailbox only if you know the delegation ID (and the user index of the account with delegate permissions if not the default account):
    https://mail.google.com/mail/d/ALGkd7w86mZOVigdDwK63uDpfMPlA2GJN7qSc4P7idKz7ffqTN0L/#compose OR
    https://mail.google.com/mail/u/0/d/ALGkd7w86mZOVigdDwK63uDpfMPlA2GJN7qSc4P7idKz7ffqTN0L/#compose OR, for user number 4,
    https://mail.google.com/mail/u/3/d/ALGkd7w86mZOVigdDwK63uDpfMPlA2GJN7qSc4P7idKz7ffqTN0L/#compose

Solution 6 - Hyperlink

https://mail.google.com/mail/u/0/x/?&v=b&eot=1&pv=tl&cs=b

This link works for composing directly in m.gmail.com as mobile in a desktop browser. Why? It is really faster.

Solution 7 - Hyperlink

For Chrome:

  1. Set your email manager to Gmail

gmail handler

  1. Write mailto: in the address bar and press enter.

Easier:

  1. Edit search engines:

Edit search engines

Edit search engines

  1. Write mt and enter in address bar.

Solution 8 - Hyperlink

Many others have done an excellent job here giving a basic answer, especially Tobias Mühl. As mentioned, GMail's Api very closely matches the definition given by RFC2368 and RFC6068. This is true of the extended form of the mailto: links, but it's also true in the commonly-used forms found in the other answers. Of the five parameters, four are identical (such as to, cc, bcc and body) and one received only slight modification (su is gmail's version of subject).

If you want to know more about what you can do with mailTo gmail URLs, then these RFCs might be of help. Unfortunately, Google has not published any source themselves.

To clarify the parameters:

  • to - Email to who

  • su (gmail API) / subject (mailTo API) - Email Title

  • body - Email Body

  • bcc - Email Blind-Carbon Copy

  • cc - Email Carbon Copy address

Solution 9 - Hyperlink

The example URLs for standard gmail, above, return a google error.

The February 2014 post to [thread 2583928][1] recommends replacing view=cm&fs=1&tf=1 with &v=b&cs=wh.

Note: It also no longer seems possible to autopopulate the mail body.

[1]: https://stackoverflow.com/questions/2583928/prefilling-gmail-compose-screen-with-html-text "prefilling gmail compose screen"

Solution 10 - Hyperlink

When you click on compose email in Gmail notice that the url changes from https://mail.google.com/mail/u/0/#inbox to https://mail.google.com/mail/u/0/#inbox?compose=new. Now when you enter say a email id [email protected] , the value for compose changes now the url became https://mail.google.com/mail/u/0/#inbox?compose=150b0f7ffb682642.

So this is working fine with my html hyperlink until the account is signed in, but if the account is not signed in it would take me the login page and when I enter the credentials somehow this compose value is lost and this does not work.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionrobertwbradfordView Question on Stackoverflow
Solution 1 - HyperlinkrobertwbradfordView Answer on Stackoverflow
Solution 2 - HyperlinkdjanowskiView Answer on Stackoverflow
Solution 3 - HyperlinkTobias MühlView Answer on Stackoverflow
Solution 4 - Hyperlinkuser2506814View Answer on Stackoverflow
Solution 5 - HyperlinkMatthewView Answer on Stackoverflow
Solution 6 - HyperlinkelchapugabrielView Answer on Stackoverflow
Solution 7 - HyperlinksitesView Answer on Stackoverflow
Solution 8 - HyperlinkHoldOffHungerView Answer on Stackoverflow
Solution 9 - HyperlinkMatthew MillarView Answer on Stackoverflow
Solution 10 - HyperlinkHarkirat SalujaView Answer on Stackoverflow