Html 电子邮件正文中的超链接在浏览器中有效,但在 Gmail 移动应用程序中无效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/48326968/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 15:04:00  来源:igfitidea点击:

Hyperlinks within email body work in browser but not Gmail mobile app

htmlgmail

提问by Shaul Behr

I've got a program that generates email reports and sends to certain recipients. The email contains a table of contents with hyperlinks to bookmarks later in the email.

我有一个程序可以生成电子邮件报告并发送给某些收件人。该电子邮件包含一个目录,其中包含指向电子邮件后面书签的超链接。

This works perfectly when viewing mails in the browser, e.g. on gmail.com. However, recently something seems to have changed in the Gmail mobile app, and my hyperlinks no longer work there.

这在浏览器中查看邮件时非常有效,例如在 gmail.com 上。但是,最近 Gmail 移动应用程序中的某些内容似乎发生了变化,我的超链接在那里不再有效。

When generating the email, the link is of the form:

生成电子邮件时,链接的形式为:

<a href="section_1">Section 1</a>

and the bookmark is of the form:

书签的格式如下:

<a name="section_1"/>    

In the browser, the link URL appears in the form:

在浏览器中,链接 URL 以以下形式显示:

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

In the Gmail app, however, the link appears in the form:

但是,在 Gmail 应用程序中,链接以以下形式显示:

x-thread://-90370221/435827759917983#m_3653008429050877336_1

Any ideas what has changed, and how to make my intra-document hyperlinks work again?

有什么想法发生了什么变化,以及如何让我的文档内超链接再次工作?

采纳答案by DadyByte

Orignal Answer

原始答案

This functionality is not available in gmail app. Here is the link to google forum where you can confirm:

此功能在 Gmail 应用程序中不可用。这是谷歌论坛的链接,您可以在其中确认:

https://productforums.google.com/forum/#!topic/gmail/CdhA_3Z1yTo

https://productforums.google.com/forum/#!topic/gmail/CdhA_3Z1yTo

You can insert link in the gmail app (like http://www.google.com) in Gmail app which is automatically converted to clickable link when you send the message but if you want hyperlink (like "click here" and when you click on it you are directed to the link to the page) you will have to do it from your browser only. There is no option available in Gmail app to do that.

您可以在 Gmail 应用程序的 Gmail 应用程序(如http://www.google.com)中插入链接,当您发送邮件时,该链接会自动转换为可点击链接,但如果您想要超链接(如“点击此处”,当您点击在它上面,您将被定向到该页面的链接)您必须仅从浏览器中执行此操作。Gmail 应用程序中没有可用的选项来执行此操作。

The alternate solution is to use Microsoft Outlook. Add your google account in Outlook app.

替代解决方案是使用 Microsoft Outlook。在 Outlook 应用中添加您的 google 帐户。

In the compose section long press in the area then you get option to add hyperlink.

在撰写部分长按该区域,然后您可以选择添加超链接。

Answer after discussion in chat

在聊天中讨论后回答

It seems that the problem is with the gmail app version. If you want to open links received in your gmail app so that you are redirected to the location of message in the same mail you need to have minimum version 8 of gmail app. Verified this as I was able to access the links in my gmail app as well as my browser.

似乎问题出在 gmail 应用程序版本上。如果您想打开在您的 Gmail 应用程序中收到的链接,以便将您重定向到同一邮件中的邮件位置,您需要拥有最低版本的 Gmail 应用程序 8。验证了这一点,因为我能够访问我的 Gmail 应用程序和浏览器中的链接。

Platforms on which veried the links:

验证链接的平台:

Android 6.0.1 - Gmail Version: 8.1.7.182107449.release

Android 6.0.1 - Gmail 版本:8.1.7.182107449.release

Windows 10 - Chrome: Version 63.0.3239.132

Windows 10 - Chrome:版本 63.0.3239.132

Ubuntu 16.04 (xenial) - Firefox: Version 57.0.4

Ubuntu 16.04 (xenial) - Firefox:版本 57.0.4

回答by Falk Gno

To get around the Gmail app not having an option to insert a link into text (hyperlink) on my mobile device I use another mobile app to compose the email first. Currently, the only app I have discovered to be compatible with this trick is Google Docs. I find it works for typing, formatting, inserting images and creating hyperlinks.

为了绕过 Gmail 应用程序无法在我的移动设备上将链接插入文本(超链接)的选项,我首先使用另一个移动应用程序撰写电子邮件。目前,我发现唯一与此技巧兼容的应用程序是 Google Docs。我发现它适用于打字、格式化、插入图像和创建超链接。

To upload from Google Docs into Gmail I am presently only aware of the ability to highlight the planned body of the email in Google Docs then pasting it into Gmail.

要从 Google Docs 上传到 Gmail,我目前只知道能够在 Google Docs 中突出显示电子邮件的计划正文,然后将其粘贴到 Gmail。

Using Google Docs I am aware of the ability to carry over changes to some features of the hypertext. Such as colour, boldness, italics, size, underline. There are possibly more customizable options available before inserting what you have composed into Gmail.

使用 Google Docs 我知道可以对超文本的某些功能进行更改。例如颜色、粗体、斜体、大小、下划线。在将您撰写的内容插入 Gmail 之前,可能还有更多可自定义的选项可用。

I am unaware of any tricks to create a usable hyperlink of images for use in the Gmail app.

我不知道在 Gmail 应用程序中创建可用的图像超链接的任何技巧。

Such a feature outside the “Signature” on Gmail desktop could prove most beneficial.

Gmail 桌面上“签名”之外的此类功能可能被证明是最有益的。

回答by Mohd Asim Suhail

I found a link on these forums with a fix. Essentially they said that if you put a span inside the link, it will fix the problem. I've not yet had a chance to test it however. According to the post:

我在这些论坛上找到了一个修复链接。基本上他们说,如果你在链接中放置一个跨度,它将解决问题。然而,我还没有机会测试它。根据帖子:

This won't work:

这行不通:

<a href="#foo">Bar</a>

But either of the following will:

但以下任一情况都会:

<a href="#foo"><span>Bar</span></a>
<a href="#foo"><font>Bar</font></a>

回答by Brandon

You can't do it in the gmail mobile app. Sorry. Also, it matters what version you have.

您不能在 Gmail 移动应用程序中执行此操作。对不起。此外,您拥有的版本很重要。