120

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/?to=inbox@example.com&bcc=admin@example.com&subject=Hey#compose

Any ideas? Thanks.

Community
  • 1
  • 1
robertwbradford
  • 6,181
  • 9
  • 36
  • 61
  • The URL from the answer below doesn't seem to work, did you find a way to achieve that? – alkar Dec 18 '12 at 16:57
  • Is there any way where we can open mail window as if its reply to or forward via url ? So that users can directly forward or can reply to email. – Kartik Domadiya Jul 29 '14 at 04:05
  • @Kartik, I've created a similar question [here](http://stackoverflow.com/questions/28671113/edit-or-forward-an-existing-mail-into-gmail-compose-window). Unfortunately, no answers yet. Do you know how to achieve that? – Daniel Marín Feb 23 '15 at 15:55

13 Answers13

209

This seems to work (for now):

https://mail.google.com/mail/?view=cm&fs=1&to=someone@example.com&su=SUBJECT&body=BODY&bcc=someone.else@example.com

robertwbradford
  • 6,181
  • 9
  • 36
  • 61
  • 1
    What about a version for Google apps? Any ideas? – cronoklee May 24 '12 at 15:54
  • 4
    do you know how to set the from parameter? I have in my gmail several accounts to select from when sending... and I'd like to be able to set a desired one via url parameter – DS_web_developer Sep 26 '12 at 07:40
  • 1
    Anybody has idea of other services offering this approach? Yahoo, Outlook, MSN? – Sunny R Gupta Nov 13 '13 at 04:59
  • How about using the Plus sign '+' with that method? Going to https://mail.google.com/mail/?view=cm&fs=1&to=name+extra@gmail.com doesn't resolve the +. – floribon Apr 02 '14 at 01:12
  • 6
    @cronoklee I know it's old, but maybe someone could use it... for google apps, use http://mail.google.com/a/domain.com/mail?view=cm... – apprenticeDev Jul 17 '14 at 01:14
  • Is there any way where we can open mail window as if its reply to or forward via url ? So that users can directly forward or can reply to email. – Kartik Domadiya Jul 29 '14 at 04:05
  • @floribon You can attribute a name alongside the email in the tranditional manner: "name " - https://mail.google.com/mail/?view=cm&fs=1&to=name%20%3Cextra@gmail.com%3E (hover over the name to see the email address in the page) – nxasdf Jan 12 '15 at 22:51
  • @nxasdf thanks that's great to know, however that doesn't solve what I'm trying to achieve, which is writting to an email address that contains the plus sign on itself, like foo+bar at gmail.com. – floribon Jan 12 '15 at 23:56
  • 1
    @floribon Oh right, that's even easier :) replace `+` with the URL encoded `%2B` - https://mail.google.com/mail/?view=cm&fs=1&to=name%2Bextra@gmail.com – nxasdf Jan 13 '15 at 18:12
  • I want to attach image and text with hyperlink how it possible please help me – RaviPatidar Aug 11 '15 at 08:57
  • @RaviPatidar I wouldn't think adding an attachment through a URL is possible. – robertwbradford Aug 11 '15 at 16:13
  • Is it posible to add atachment? – Borja Alvarez Sep 18 '15 at 12:25
  • How can I send html formatted email, just link I want to send bold text, than what should I use? – GoalDone Oct 10 '15 at 09:47
  • 1
    I'd love to see a way to get it to send automatically as well. I email things to myself all the time, and I just want to send them without actually have to press "Send." – Deane Feb 21 '16 at 13:09
  • It shows compose layout in full screen. Good but I'll choose this shortcut when it loads page faster. I watched loading bar for 2 or 3 seconds like I see it for regular gmail interface. – Oktay Apr 20 '16 at 13:20
  • This link is not working in android chrome browser. When I click on the link it takes me to in the gmail inbox instead of gmail compose section. – Gowri Aug 08 '16 at 08:00
  • Gowri: it works for me on Chrome on latest Android on a Nexus 6P. – CpnCrunch Feb 03 '17 at 23:28
  • Any way to add signature? – JustAnotherCoder Nov 01 '17 at 13:38
  • How do you include a hyperlink in the body? All I can seem to get is text. – kflaw May 04 '18 at 04:44
  • how would you add a url to the message body? Keep trying different ways to do this and it always comes out as plain text – kflaw May 04 '18 at 15:39
  • 1
    @DS_web_developer I figured it out, just specify the email with the number after the url **https://mail.google.com/mail/u/#/**. It's probably to late now anyways but just felt like including that for future references. – programmerskillz Apr 25 '19 at 22:42
  • 2
    Anyone know if is possible to attach a file or include a file in the URL? – Deleted Dec 20 '19 at 17:22
  • For those using Google Apps, start the URL with "https://mail.google.com/mail/u/?authuser=your-email&view=cm&..." as the URLs including a number aren't reliable (the number can change when restarting the browser, e.g. the GMail one tends to be given to 0). – Craig Francis Mar 20 '21 at 21:26
  • How can I encode a newline in the body? – kraftydevil Oct 13 '22 at 17:35
  • Replace newlines with %0A – kraftydevil Oct 13 '22 at 17:39
31

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.

nealmcb
  • 12,479
  • 7
  • 66
  • 91
djanowski
  • 5,610
  • 1
  • 27
  • 17
  • 1
    perfect when you want to send someone a quick message without starting to go through your inbox! – volodymyr Apr 18 '16 at 14:46
  • 1
    Thank you so much! This is exactly what I was looking for: a distraction free way to send an email - just looking at the inbox sucks you in. Wish I could upvote more than once! – GraehamF Apr 06 '18 at 17:35
  • 1
    `mailto:` link is gold! – nealmcb Jan 29 '19 at 19:41
  • This is great. I was able to add a shortcut to my taskbar that opens this and it works great. `"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --app="https://mail.google.com/mail/?view=cm&fs=1&tf=1"` – IMTheNachoMan Nov 21 '19 at 15:30
30

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

Simple Compose Link

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 (lee@example.org in this example):
    https://mail.google.com/mail/u/lee@example.org/#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.

Custom compose links

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.

  • Default account:
    https://mail.google.com/mail/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com
  • Specific account by index (second in this example):
    https://mail.google.com/mail/u/1/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com
  • Specific account by email address (lee@example.org in this example):
    https://mail.google.com/mail/u/lee@example.org/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com
  • Any account from specific domain (example.edu in this example):
    https://mail.google.com/a/example.edu/mail/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com
  • From specific delegated mailbox (id abcd1234efgh5678 in this example):
    https://mail.google.com/mail/d/abcd1234efgh5678/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com
  • From specific delegated mailbox belonging to non-default account (id 1234efgh5678ijkl, fourth user):
    https://mail.google.com/mail/u/3/d/1234efgh5678ijkl/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com

Complex compose links

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:morgan@example.com?subject=SUBJECT&body=BODY&bcc=dakota@example.com
  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 (lee@example.org in this example):
    https://mail.google.com/mail/u/lee@example.org/?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
Matthew
  • 1,300
  • 12
  • 30
  • Hi Matthew, Thank you for the detailed guide! I have several "send-as" addresses in my google workspace account. Do you know if it is possible to define the sender address from the URL as well? i tried adding &from=myspecificaddress@example.com in the url, with no success. – Kev Jan 08 '22 at 19:19
  • I can see how that would be handy for internal tools @Kev but I don't *think* it's possible. According to https://stackoverflow.com/a/9383777/145725 you can't do it and they point out that it doesn't make much sense for the standard use case (a mailto link on a public website). – Matthew Jan 18 '22 at 04:05
  • @Matthew Is it possible to open email(its in Sent folder) if I know that email Id and threadId? Just to open only email not the whole thread if email was replied& – Nyuokimi May 09 '22 at 11:20
  • @Nyuokimi I'm not sure you can even do that using the GUI. Perhaps it depends on your threading settings but for me the only way I can view a reply I have sent is in the threaded conversation view. The only way I can see to get it out of the thread is to "Show original" (and view it with all its headers). I'm happy to try and dig in a bit more if you want to post a new question and share a link to it here? – Matthew May 10 '22 at 05:10
  • @Matthew hERE is link to the question https://stackoverflow.com/questions/72182265/how-to-open-specific-email-without-whole-thread-in-gmail – Nyuokimi May 10 '22 at 07:30
  • https://stackoverflow.com/questions/74230615/search-for-a-message-using-message-id-using-gmail-url-parameters something like this is possible? – user16731842 Oct 28 '22 at 04:19
13

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

Community
  • 1
  • 1
Tobias Mühl
  • 1,788
  • 1
  • 18
  • 30
  • 1
    Thanks for listing a source, and an RFC at that! But I found one way gmail and the RFC are different: gmail uses `su=`, the RFC uses `subject=`. Other than that, they appear identical. RFC 2368 was also useful. – HoldOffHunger Feb 21 '20 at 17:08
12

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
Andy
  • 17,423
  • 9
  • 52
  • 69
user2506814
  • 121
  • 1
  • 2
  • 1
    Any way around the fact that this is dependent on the order that you signed into each account? – Matt May 23 '15 at 19:57
  • 7
    @Matt Yes, you can use https://mail.google.com/mail/u/your@email.com/#inbox?compose=new instead of the numeric index. – Eivind Eklund Aug 27 '16 at 19:27
  • 1
    how to add recipient email? `compose=new&to=blahblah@gmail` isn't working – Dee Mar 07 '21 at 10:48
8

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.

  • 1
    the link works and is fast. but not as OP requested which can pre-fill in bcc and cc also from URL. Also it would have made it awesome if it could attach file using regular HTML input type file. – IsmailS Dec 09 '15 at 05:16
6

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.
sites
  • 21,417
  • 17
  • 87
  • 146
4

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
Community
  • 1
  • 1
HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133
0

None of the other answers seem to address the original question which explicitly asks for the "full Gmail interface". I believe this means wanting to open a prefilled compose message in a window rather than the fullscreen interface.

You cannot pre-populate fields in the windowed interface, only in the fullscreen one.

The windowed interface only allows you to customize which account will be used to send the email, while the fullscreen interface allows you to send the 5 mailto parameters (e.g. "to", "body", etc.):

https://mail.google.com/mail/u/0/?tf=cm&to=to@example.com&cc=cc@example.com,cc2@example.com&bcc=bcc@example.com&su=subject+here&body=line1%0Aline2

See this answer for a lot of examples.

Senseful
  • 86,719
  • 67
  • 308
  • 465
0

If you're setting default email programs in linux, create this default script to make Gmail your default. Let's call it new-email.sh (You can pick your own). Create this script anywhere in your system and make it executable. chmod 700 new-email.sh Replace firefox with a web browser of your choice. Then pick that script (new-email.sh) in your linux system settings for your default email program. The parameters passed from the mailto links will be translated automagically. The body will also auto-populate - tested here: https://www.scottseverance.us/mailto.html

#!/bin/bash
ARGS=`echo $1 |  sed -E 's/(mailto:)([^?]+)([?])(.*$)/\2\&\4/g'|sed "s/subject=/su=/g"`
firefox "https://mail.google.com/mail/?view=cm&to=$ARGS"
                                                     
-1

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

The February 2014 post to thread 2583928 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.

Community
  • 1
  • 1
Matthew Millar
  • 122
  • 1
  • 4
-1

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 xyz@gmail.com , 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.

Harkirat Saluja
  • 7,768
  • 5
  • 47
  • 73
  • 1
    `150b0f7ffb682642` is the ID of your email draft. This link only works when you're logged into your Gmail account. Other people clicking the link won't see the `xyz@gmail.com` as the recipient – Tobias Mühl Oct 26 '18 at 05:53
-1

<a href="mailto:?subject=BlahBlah&body=Dear%20Name,%0D%0A%0D%0AI%20would%20like%20to%20take%20this%20pportunity%20to%20,%0D%0ABest%20regards">

I test this way for my website, and it's worked. After "mailto:" write your the email you want to receive info. "%20" means the letter space. "%0D%0A%" means new paragraph.

sama byt
  • 19
  • 3