如何在提交表单时强制打开电子邮件客户端

发布于 2024-11-17 21:20:43 字数 277 浏览 0 评论 0 原文

我有一个带有提交按钮的 HTML 表单,单击该按钮后,会将表单字段中的输入通过电子邮件发送到特定电子邮件。但现在,当单击“提交”按钮时,它只会弹出一个小窗口,显示该网站正在尝试从我的 Outlook 发送电子邮件,并询问我是否允许。如何才能在发送之前打开 Outlook 并且可以查看电子邮件以及所有输入内容?我只是使用最简单的方法提交此表单,form action=mailto...method=POST按钮。

I have a HTML form with a submit button that emails the input from the form fields to a specific email when clicked. But right now, when the submit button is clicked, it just pops up a little window saying the website is trying to send email from my Outlook and asking if I will allow it. How can I make it so that Outlook opens up and I can review the email, with all the input, before it's sent? I'm just using the most straightforward method of submitting this form, form action=mailto..., method=POST, and an <input type="submit" /> button.

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

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

发布评论

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

评论(3

初见你 2024-11-24 21:20:43

你不能。

无法覆盖确认对话框,并且系统依赖于用户安装并配置了兼容的电子邮件客户端(这使得该方法极其不可靠)。

如果您想处理表单,请通过 http(s) 提交,而不是电子邮件。

You can't.

There is no way to override the conformation dialog, and the system depends on the user having a compatible email client installed and configured (which makes the approach hideously unreliable).

If you want to deal with forms, submit them over http(s), not email.

心安伴我暖 2024-11-24 21:20:43

您不能强制浏览器运行外部程序,这将是一个巨大的安全漏洞。邮件客户端是允许的外部程序之一,但仍然需要用户输入。

You can't force a browser to run an external program, that would be a huge security hole. Mail clients are one of the allowed external programs, but that still required a users input.

Smile简单爱 2024-11-24 21:20:43

处理此问题的正确方法是使用 HTML 表单和基于服务器的表单处理器。这需要一点编码知识。根据您的问题,听起来您在服务器端编码方面没有很多经验——我可以建议使用众多服务器端插件之一来处理表单并将结果通过电子邮件发送给您吗? http://www.tectite.com/ 具有易于使用和配置的 PHP FormMail。

如上所述,您不能强制浏览器打开电子邮件客户端 - 此外,许多用户使用 gmail、hotmail、yahoo mail,并且可能使用浏览器作为其客户端。您的解决方案会将大部分用户排除在响应之外!

祝你好运。

The proper way to handle this is to use an HTML form and a server based form processor. This requires a little bit of coding knowledge. Based on your question, it doesn't sound like you have a lot of experience with server-side coding-- May I suggest one of the many server side plugins that will process the form and email you the results? http://www.tectite.com/ has PHP FormMail which is easy to use and configure.

As has been stated above, you can't force a browser to open an email client-- Furthermore many users use gmail, hotmail, yahoo mail and may use the browser as their client. Your solution would exclude a large segment of users from responding!

Good luck.

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