ubuntu邮件客户端_在Ubuntu中将Gmail设置为默认邮件客户端

ubuntu邮件客户端_在Ubuntu中将Gmail设置为默认邮件客户端

ubuntu邮件客户端

Every Geek uses Gmail… it’s pretty much required. And now you can set Gmail as the default client in Ubuntu without any extra software. (Windows requires the Gmail notifier be installed)

每个极客都使用Gmail ...这是非常必要的。 现在,您可以将Gmail设置为Ubuntu中的默认客户端,而无需任何其他软件。 (Windows需要安装Gmail通知程序)

Just go to System \ Preferences \ Preferred Applications

只需转到系统\首选项\首选应用程序

ubuntu邮件客户端_在Ubuntu中将Gmail设置为默认邮件客户端

Under Mail Reader, select Custom, and then put this into the Command window, changing “geek” to your username.

在“邮件阅读器”下,选择“自定义”,然后将其放入“命令”窗口,将“ geek”更改为您的用户名。

/home/geek/open_mailto.sh %s

/home/geek/open_mailto.sh%s

Next, you’ll need to save this shell script into your user directory ( /home/username ).

接下来,您需要将此Shell脚本保存到用户目录(/ home / username)中。

For the curious, here’s the contents of the script:

出于好奇,这是脚本的内容:

#!/bin/sh

#!/ bin / sh

firefox https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed ‘s/mailto://’`

firefox https://mail.google.com/mail?view=cm&tf=0&to=`echo $ 1 | sed's / mailto://'`

If you’d like to make the script open a new tab in an existing Firefox window, you can replace the firefox line in the script with the following:

如果您想让脚本在现有的Firefox窗口中打开一个新标签,则可以用以下内容替换脚本中的firefox行:

firefox -remote “openurl(https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed ‘s/mailto://’`,new-tab)”

firefox -remote“ openurl(https://mail.google.com/mail?view=cm&tf=0&to=echo $ 1 | sed's / mailto://',new-tab)”

Update: If you want to make the script file hidden by default, you can rename it with a . at the beginning of the file like this: .open_mailto.sh. You’ll have to change the path in the preferences, of course.

更新:如果要默认隐藏脚本文件,可以使用来重命名该脚本文件。 在文件开头的位置是:.open_mailto.sh。 当然,您必须在首选项中更改路径。

Open a terminal and type in the following command, to make the script executable:

打开终端并输入以下命令,以使脚本可执行:

chmod u+x ~/open_mailto.sh

chmod u + x〜/ open_mailto.sh

Now it should be working.

现在应该可以了。

To test it out… I clicked the contact link on my page… and it immediately opened in Gmail.

要对其进行测试...我单击了页面上的联系人链接...,该链接立即在Gmail中打开。

ubuntu邮件客户端_在Ubuntu中将Gmail设置为默认邮件客户端

Note that if you aren’t logged into Gmail you’ll be prompted to login to gmail… and you’ll have to click the email link again. Seems like Gmail’s login redirector won’t open the send mail page. But then again… why aren’t you logged into Gmail?

请注意,如果您没有登录Gmail,系统将提示您登录gmail…,并且您必须再次单击电子邮件链接。 似乎Gmail的登录重定向器无法打开“发送邮件”页面。 但是再说一次……为什么不登录Gmail?

Update: Changed to point to a script so that the mailto: tag would be removed. Thanks VERY much to Mr Linux for not just noticing, but giving me the working script.

更新:更改为指向脚本,以便删除mailto:标记。 非常感谢Linux先生,他不仅注意到了我,还给了我有效的脚本。

翻译自: https://www.howtogeek.com/howto/ubuntu/set-gmail-as-default-mail-client-in-ubuntu/

ubuntu邮件客户端