将 HTML 表单放入电子邮件中是否不切实际?

发布于 2024-07-11 17:17:03 字数 1431 浏览 13 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

俏︾媚 2024-07-18 17:17:03

1. 电子邮件中的 HTML 被一些人视为一种祸害

它几乎无法正常工作,即使可以正常工作,也无法正常工作。

我最近经历了一个案例,一封相当长的 html 电子邮件,虽然撰写得很好并且工作得很好,但被 GMail 切成两半并过早地修剪(由于长度),这对设计造成了一些影响。

我也遇到过这样的情况:HTML 格式非常错误,导致电子邮件出现在我的收件箱中,就好像它实际上是一封空白电子邮件一样。

2. 我不信任电子邮件中的表单

主要出于安全原因,某些客户端可能会拦截表单操作,并且发布操作不会去任何地方(特别是在他们有物理电子邮件客户端、打开 Web 浏览器的情况下通过它发布数据,这相当复杂)。

你最好在一个你可以控制的网站上有一个表单,而且人们不会有任何令人讨厌的惊喜(特别是如果你需要 javascript 来执行表单,许多电子邮件客户端不会忍受)

也许,您可以放入一个表单,但为了理智起见,请尽可能向后兼容,以便使用 PineMutt 等基于文本的浏览器的人仍然可以阅读它,并且被给予一个不需要客户端魔法的工作表单的链接。

1. HTML in email is perceived by some to be a blight

It just hardly ever works, and when it does work, it doesn't work properly.

I recently experienced a case where a rather lengthy html email, although well composed and worked rather well, was cut in half and prematurely trimmed by GMail ( due to length ) which mangled the design a bit.

I've also had cases where the HTML was so malformed the email turned up in my inbox as if it were really a blank email.

2. I don't trust forms in my email

For security reasons mostly, some clients may intercept the form action, and the post action won't go anywhere ( Especially in cases where they have a physical email client, Open Web browser and posting data via it, thats rather complicated ).

You are simply better off having a form on a website that you can control, and people don't have any nasty surpises about ( Especially if you need javascript to execute the form, many email clients won't put up with that )

Maybe, you can put a form in, but for the sake of sanity, be as backwards compatible as possible, so that somebody with a text based browser like Pine or Mutt can still read it, and be given a link to a working form that doens't require client magic.

无人问我粥可暖 2024-07-18 17:17:03

简单的答案是否定的,你不能。 尝试告诉您的客户这样的事情:

几乎没有任何电子邮件客户端会允许电子邮件中包含 HTML 表单,并且某些垃圾邮件系统会专门阻止和删除包含表单的电子邮件。 这是出于安全考虑。 发送的带有表单的电子邮件很可能连五分之一都达不到收件人的收件箱。

Simple answer is no, you can't. Try telling your client something like this:

Hardly any email clients will allow HTML forms in email, and some spam systems specifically block and delete emails that contain forms. This is due to security. There's a good chance that not even a fifth of the emails that are send with forms in them will even reach the recipients in-box.

意犹 2024-07-18 17:17:03

是的,我已经看到这样做了(例如,来自 LiveJournal 的电子邮件就是这样做的)。 正如您所提到的,但这不是您应该依赖的工作。 不过,只需将操作设置为要发布到的完整 URL 的 HTML 表单即可在支持的地方工作。

它适用于我使用过的大多数基于网络的电子邮件系统,但我不知道有多少独立客户端可以处理它。

Yes, I've seen this done (emails from LiveJournal do this, as an example). As you mention it's not something you should rely upon working, though. Just putting an HTML form with action set to the full URL to post to should work wherever it's supported, however.

It's worked in most web-based email systems I've used but I don't know how many standalone clients would deal with it.

秋日私语 2024-07-18 17:17:03

你是对的 - 任何重要部分的电子邮件客户端都不太可能很好地处理这个问题。 让纯 HTML 在电子邮件客户端中一致工作已经够困难的了,更不用说像表单这样的“高级”功能了。 我向您保证,如果您将其发送给具有不同电子邮件客户端的受众,至少 80% 的人会说“您的表单不起作用”。

如果您不确定,请注册六个免费电子邮件帐户,再加上一个可以通过 imap 访问的帐户。 将带有简单表格的电子邮件发送给所有帐户,并通过 3 个不同的客户端(例如 Thunderbird、Outlook 和 Eudora)查看 imap。 看看它是否有效,并告诉我们。

You're correct - it's very unlikely that any significant portion of email clients will handle this well. It's hard enough getting plain HTML to work consistently in email clients, let alone "advanced" functionality like forms. I promise you that if you send it out to an audience with a heterogeneous mix of email clients, at least 80% of them will say "your form doesn't work".

If you're not sure, sign up for half a dozen free email accounts, plus one you can access via imap. Send the email with a simple form to all the account, plus view the imap one through 3 different clients (say, Thunderbird, Outlook, and Eudora). See if it works, and let us know.

花期渐远 2024-07-18 17:17:03

只想提供一个调查/表单捕获网站的链接。

你遇到的问题是 -

A. 并非每个人都接受 HTML 电子邮件

b. 您将如何处理验证? 即使表单确实从邮件客户端提交到目标服务器,您也需要在服务器上处理验证。 这有可能让人们感到困惑,“我在这里开始填写表格,现在我在这里……这会带来什么?” 一种方式。

I would just provide a link to the survey/form capture site.

The problem you have is -

a. Not everyone accepts HTML email

b. How are you going to handle validation? Even if the form did submit from within the mail client to the destination server, you'd need to handle validation on the server. That's got potential to confuse the hell out of folk in a 'I started the form here, now I'm here...what gives?' kind of way.

执妄 2024-07-18 17:17:03

如果不能保证客户妥善处理它,我会说这是不切实际的。 您是否真的希望将邮件发送到收件人将执行某些操作的地方,然后该操作可能已完成,也可能尚未完成?

我也觉得这最烦人。

If there's no guarantee of clients properly handling it, I would say it's impractical. Do you really want to be sending mails out where the recipient will perform some action, and then it may or may not have actually been accomplished?

I also would find this most annoying.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文