如何阻止Gmail从网址中删除值?

Que*_*ner 9 html email gmail

我最近了解到,网络邮箱,如Gmail会做改变HTML电子邮件,例如添加target="_blank"<a>标签.

我还发现其他改动也会发生.当我从PHP脚本向Gmail(可能还有其他Web邮件客户端)发送HTML电子邮件时,任何链接的URL中包含的变量值都将被删除.因此,例如,这是我在PHP代码中设置的值:

$mailContent = '<p><a target="_blank" href="https://example.com/confirmation.html?verification=x1x1x1x1x1x1x1x&email=yyyy@email.com">click here to go to the web site and activate your account!</a></p>';
Run Code Online (Sandbox Code Playgroud)

但是,当在Gmail中收到电子邮件时,HTML代码如下所示:

<p><a target="_blank" href="https://example.com/confirmation.html?verification=&email=">click here to go to the web site and activate your account!</a></p>
Run Code Online (Sandbox Code Playgroud)

x1x1x1x1x1x1x1xyyyy@email.com已经从内部剥离出来<a>的标签.

如何保护我要传递给URL的变量值,以便Gmail不会删除它们?

Pet*_*ver 3

单击Gmail 中邮件上的“查看原始/来源”,查看 URL 是否与当时应有的一样。如果是这样,您就知道问题出在 Gmail 如何格式化邮件以供您查看。如果它甚至在源代码中也被破坏,我想知道您的网页/php/CMS(您是否使用一个)中是否有任何内容更改了代码。

你应该尝试像 @Crisp 所说的URL 编码。这是W3 参考