如何摆脱 GMail HTML 电子邮件中的“显示修剪的内容”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11078264/
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 01:05:18  来源:igfitidea点击:

How to get rid of "Show trimmed content" in GMail HTML emails?

htmlgmailhtml-email

提问by Munim

I send a lot of HTML emails. The problem with GMail is, if there are more than one emails with the same subject, it hides some similar content and shows a "..." to show the "trimmed content". This screws up with my formatting.

我发送了很多 HTML 电子邮件。GMail 的问题是,如果有不止一封具有相同主题的电子邮件,它会隐藏一些相似的内容并显示“...”以显示“修剪过的内容”。这搞砸了我的格式。

If changing the subject is not an option, is there is any way to avoid this behaviour?

如果不能改变主题,有什么办法可以避免这种行为?

Edit: I should clarify that I programmatically send emails using Amazon SES from a php script. That is why I posted the question in Stack Overflow.

编辑:我应该澄清一下,我通过 php 脚本使用 Amazon SES 以编程方式发送电子邮件。这就是我在 Stack Overflow 中发布问题的原因。

采纳答案by dougwoodrow

I've just encountered this problem myself, and from my investigations it seems that GMail does indeed trim the content if it is similar to the preceding emails.

我自己刚刚遇到了这个问题,从我的调查来看,如果内容与前面的电子邮件类似,GMail 似乎确实会修剪内容。

My solution is simply to insert the current time stamp at the end of every email:

我的解决方案只是在每封电子邮件的末尾插入当前时间戳:

[15:02:21 29/01/2013] End of message.

[15:02:21 29/01/2013] 消息结束。

回答by Troggy

To prevent this in HTML emails I'm adding two invisible unique elements: in the beginning and at the end of the mail. Like this:

为了防止在 HTML 电子邮件中出现这种情况,我添加了两个不可见的独特元素:在邮件的开头和结尾。像这样:

...

<body>
<!-- this ensures Gmail doesn't trim the email -->
<span style="opacity: 0"> {{ randomness }} </span>

...

<!-- this ensures Gmail doesn't trim the email -->
<span style="opacity: 0"> {{ randomness }} </span>
</body>

{{ randomness }}is being replaced by my templating engine with the value of Date.now()(I'm using node.js, could be anything producing unique output)

{{ randomness }}正在被我的模板引擎替换为Date.now()(我正在使用 node.js,可以是任何产生独特输出的东西)

回答by Sarthak

Voilà! Finally after long testing I have found a solution to this problem.

瞧!经过长时间的测试,我终于找到了解决这个问题的方法。

What Gmail does is it puts in the "Show Trimmed Content" option if the message is similar to previous ones, or the subject of the email appears as it is in the content of the email.

Gmail 的作用是,如果邮件与以前的邮件相似,或者邮件主题与邮件内容中的内容相同,它会放入“显示修剪后的内容”选项。

To avoid this, simply try inserting any randomly generated string inside your mail which will make your email messages different and will not let Gmail insert the Show Trimmed Content option.

为避免这种情况,只需尝试在您的邮件中插入任何随机生成的字符串,这将使您的电子邮件有所不同,并且不会让 Gmail 插入“显示修剪的内容”选项。

回答by Ankita.P

If you cannot change your subject you can surely go for the optimization of HTML mailers.

如果你不能改变你的主题,你当然可以去优化 HTML 邮件程序。

  1. Because HTML file size allowed by Gmail is 102kb. If Gmail finds that your HTML file size is above 102kb then it will show message clipped at the bottom of your HTML mailer. File size is regardless of the image size which are included in the mailers(I am considering image link here).

  2. If there are many white spaces and carriage return in your HTML file. So best option is to inline your CSS using mail chimps inline CSS tool and then compressing your HTML file (Then are numerous HTML compressors available online). This 2 tricks should surely work in order to avoid your email has been clipped message.

  1. 因为 Gmail 允许的 HTML 文件大小是 102kb。如果 Gmail 发现您的 HTML 文件大小超过 102kb,那么它会在您的 HTML 邮件程序底部显示剪裁的邮件。文件大小与邮件中包含的图像大小无关(我在这里考虑图像链接)。

  2. 如果您的 HTML 文件中有很多空格和回车。所以最好的选择是使用邮件黑猩猩内联 CSS 工具内联你的 CSS,然后压缩你的 HTML 文件(然后有许多在线可用的 HTML 压缩器)。这两个技巧肯定会起作用,以避免您的电子邮件被剪掉消息。

For more reference can visit thislink.

更多参考可以访问这个链接。

回答by Vicky

Settings --> General --> Conversation View --> Conversation View off

设置 --> 常规 --> 对话视图 --> 对话视图关闭

This will basically not group the emails plus won't trim the contents.

这基本上不会对电子邮件进行分组,并且不会修剪内容。

回答by dush88c

I think this would be best option to avoid the "Hide expanded content Gmail" and prevent the content be stripped.

我认为这将是避免“隐藏扩展内容 Gmail”并防止内容被剥离的最佳选择。

There are two ways to do it.

有两种方法可以做到。

  1. Just add a random number at the end of your email
  2. Just adding bookmarklet to your bookmark toolbar and just click when you are going to compose an email
  1. 只需在电子邮件末尾添加一个随机数
  2. 只需将书签添加到您的书签工具栏,并在您要撰写电子邮件时单击

For more details please follow the below link

欲知更多详情,请点击以下链接

Refference

参考

回答by Victoria Ruiz

There are some workarounds in this thread:

此线程中有一些解决方法:

http://productforums.google.com/forum/#!topic/gmail/yoAlDr3PyN4

http://productforums.google.com/forum/#!topic/gmail/yoAlDr3PyN4

Workarounds seem to be lame though. I hope you have a second name.....

不过,解决方法似乎很蹩脚。我希望你有第二个名字......

I just remember that there was one recommendation, to use a different name in your signature.

If your name is Jim, try using Melvin, or Horatio. That should prevent the trimming, but it's not guaranteed.

我只记得有一个建议,在您的签名中使用不同的名称。

如果您的名字是 Jim,请尝试使用 Melvin 或 Horatio。这应该可以防止修剪,但不能保证。

回答by sttdvs

Inserting one or two random characters below your signature seems to confuse gmail enough to leave content untrimmed but also makes me look like a drunk crazy person. This issue needs to be resolved if google wants people to take gmail seriously. I would like the option to integrate more google products but flubs like this which should be no brainers make it difficult to commit.

在您的签名下方插入一两个随机字符似乎足以让 gmail 感到困惑,以至于无法修剪内容,但也让我看起来像个醉酒的疯子。如果谷歌希望人们认真对待 gmail,这个问题需要解决。我想要集成更多谷歌产品的选项,但像这样的错误应该是毫无疑问的,这使得提交变得困难。

回答by Zoot

In addition to the other answers, be aware that messages over 102K in size are likely to be trimmed. Watch out for bloated CSS or inlined images contributing to a file size that's too large.

除了其他答案之外,请注意大小超过 102K 的消息可能会被修剪。注意导致文件过大的臃肿 CSS 或内联图像。

Edit: Some sources of this information for the curious-

编辑:这个信息的一些来源好奇-

回答by Joel James

Just insert any unique content after the trimmed contents. That can be anything. Even you can make it invisible by adding it in very light color, like light gray.

只需在修剪后的内容后插入任何独特的内容。那可以是任何东西。甚至您也可以通过将其添加为非常浅的颜色(例如浅灰色)来使其不可见。