当然,这是有效的:
https://mail.google.com/mail/u/0/#compose
但是,我还想添加一个主题、收件人、密送等。我尝试了类似下面的方法,但是没有成功:https://mail.google.com/mail/?to=inbox@example.com&bcc=admin@example.com&subject=Hey#compose
有什么想法吗?谢谢。https://mail.google.com/mail/u/0/#compose
但是,我还想添加一个主题、收件人、密送等。我尝试了类似下面的方法,但是没有成功:https://mail.google.com/mail/?to=inbox@example.com&bcc=admin@example.com&subject=Hey#compose
有什么想法吗?谢谢。目前这似乎有效:
收藏这个链接应该会给你一个全屏的撰写窗口,没有任何干扰:
https://mail.google.com/mail/?view=cm&fs=1&tf=1
另外,如果你想要更好的兼容性(例如看到其他问题中的链接已经不能工作了),你可以收藏以下链接:
mailto:
它将打开您的默认电子邮件客户端,您可能已经为此目的配置了Gmail。
mailto:
链接非常有用! - nealmcb"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --app="https://mail.google.com/mail/?view=cm&fs=1&tf=1"
- IMTheNachoMan我想汇总几个好的答案和评论,提供一些额外的信息。先看例子,下面是术语背景和解释。
注意:如果没有匹配项,所有链接将回到默认帐户
在右下方打开一个带有组成窗口的收件箱
https://mail.google.com/mail/#compose
https://mail.google.com/mail/u/1/#compose
https://mail.google.com/mail/u/lee@example.org/#compose
https://mail.google.com/a/example.edu/mail/#compose
https://mail.google.com/mail/d/abcd1234efgh5678/#compose
https://mail.google.com/mail/u/3/d/1234efgh5678ijkl/#compose
以上每个示例将自动从#compose
重定向到#inbox?compose=new
。您可以使用任何一个URL。
通过直接打开“撰写邮件”(cm)视图,包括收件人地址、主题、正文、抄送和密送。甚至在没有fs=1
参数的情况下,这也会全屏显示组成消息视图。可能在URL中遇到一些特殊字符。
https://mail.google.com/mail/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com
https://mail.google.com/mail/u/1/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com
https://mail.google.com/mail/u/lee@example.org/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com
https://mail.google.com/a/example.edu/mail/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com
https://mail.google.com/mail/d/abcd1234efgh5678/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com
https://mail.google.com/mail/u/3/d/1234efgh5678ijkl/?view=cm&to=morgan@example.com&su=SUBJECT&body=BODY&bcc=dakota@example.com
您可以将任何可以放在 mailto:
链接中的内容传递给 Gmail。您需要先URL编码* mailto 链接。这会处理重音字母和其他 URL 可能无法识别的特殊字符:
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
https://mail.google.com/mail/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
https://mail.google.com/mail/u/1/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
https://mail.google.com/mail/u/lee@example.org/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
https://mail.google.com/a/example.edu/mail/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
https://mail.google.com/mail/d/abcd1234efgh5678/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
https://mail.google.com/mail/u/3/d/1234efgh5678ijkl/?extsrc=mailto&url=mailto%3Amorgan%40example.com%3Fsubject%3DSUBJECT%26body%3DBODY%26bcc%3Ddakota%40example.com
*有关URL编码/百分比编码的更多信息请参见维基百科。撰写本文时,urlencoder.io允许您在线进行编码,并提供了如何使用几种常见语言进行URL编码的博客文章链接。
https://mail.google.com/mail/u/0/#inbox
/mail
之前插入/a/<domain>
来指定 Google Workspace 域名 (而用户索引/u/<index>
则在/mail
之后输入)。当您在公司内部提供链接且希望该链接用于撰写新邮件时,这非常有用 (无论他们使用什么顺序登录其各种帐户)。https://mail.google.com/mail/d/ALGkd7w86mZOVigdDwK63uDpfMPlA2GJN7qSc4P7idKz7ffqTN0L/#compose
或https://mail.google.com/mail/u/0/d/ALGkd7w86mZOVigdDwK63uDpfMPlA2GJN7qSc4P7idKz7ffqTN0L/#compose
或者,对于用户号为 4,https://mail.google.com/mail/u/3/d/ALGkd7w86mZOVigdDwK63uDpfMPlA2GJN7qSc4P7idKz7ffqTN0L/#compose
GMail 网页客户端支持 mailto:
链接。
对于常规的 @gmail.com
帐户: https://mail.google.com/mail/?extsrc=mailto&url=...
对于在域名为 gsuitedomain.com
的 G Suite 帐户: https://mail.google.com/a/gsuitedomain.com/mail/?extsrc=mailto&url=...
...
需要替换为一个 urlencoded 的 mailto:
链接。
su=
,而RFC使用subject=
。除此之外,它们看起来完全一样。RFC 2368也非常有用。 - HoldOffHunger值得注意的是,如果您有多个Gmail帐户,则可能希望使用URL方法,因为您可以自定义要从哪个帐户撰写。
例如:
https://mail.google.com/mail/u/0/#inbox?compose=new
https://mail.google.com/mail/u/1/#inbox?compose=new
或者,如果您知道您正在发送邮件的电子邮件地址,请用该电子邮件地址替换数字索引:
https://mail.google.com/mail/u/your@email.com/#inbox?compose=new
compose=new&to=blahblah@gmail
不能正常工作。 - Dee对于Chrome浏览器:
更简单的方法:
其他人在这里已经给出了基本答案,特别是Tobias Mühl。如上所述,Gmail的Api非常接近RFC2368和RFC6068所定义的规范。这适用于mailto:链接的扩展形式,也适用于其他回答中常用的形式。在五个参数中,有四个是相同的(例如to
、cc
、bcc
和body
),只有一个稍作修改(su
是gmail版本的subject
)。
如果您想了解有关使用mailTo gmail URLs的更多信息,则这些RFC可能会有所帮助。不幸的是,Google自己并没有发布任何源代码。
澄清一下这些参数:
to
- 邮件收件人su
(gmail API) / subject
(mailTo API) - 邮件主题body
- 邮件正文bcc
- 邮件密送地址cc
- 邮件抄送地址其他答案似乎都没有解决原问题,原问题明确要求“完整的Gmail界面”。我认为这意味着想要在窗口中打开一个预填充的撰写邮件,而不是全屏界面。
您无法在窗口界面中预填字段,只能在全屏界面中预填。
窗口界面仅允许您自定义将用于发送电子邮件的帐户,而全屏界面允许您发送5个mailto
参数(例如“to”,“body”等):
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
请参考这个答案,里面有很多例子。
如果您正在设置Linux中的默认电子邮件程序,请创建此默认脚本将Gmail设置为默认值。我们称其为new-email.sh
(您可以选择自己的)。在系统中的任何位置创建此脚本并使其可执行。chmod 700 new-email.sh
使用您选择的Web浏览器替换firefox
。然后在Linux系统设置中选择该脚本(new-email.sh
)作为您的默认电子邮件程序。传递的参数将自动转换为mailto链接。正文也会自动填充-在此处进行了测试: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"