提交按钮上的Mailto [英] Mailto on submit button

查看:41
本文介绍了提交按钮上的Mailto的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在像 <input type="submit"/> 这样的提交按钮上实现 mailto: 功能?我使用 ASP.NET MVC.也许有一些棘手的控制器动作结果来实现这一点.你能帮我吗?

Is it possible to implement mailto: function on submit button like <input type="submit" />? I use ASP.NET MVC. Maybe there is some tricky controller action result to achieve this. Could you please help me?

附言我知道我可以让锚看起来像一个按钮.

P.S. I know that I can make anchor looks like a button.

推荐答案

在 HTML 中,您可以在

元素的 中指定 mailto: 地址[action] 属性.

In HTML you can specify a mailto: address in the <form> element's [action] attribute.

<form action="mailto:youraddr@domain.tld" method="GET">
    <input name="subject" type="text" />
    <textarea name="body"></textarea>
    <input type="submit" value="Send" />
</form>

这将允许用户的电子邮件客户端创建一封电子邮件,其中预先填充了 中的字段.

What this will do is allow the user's email client to create an email prepopulated with the fields in the <form>.

不会发送电子邮件.

这篇关于提交按钮上的Mailto的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆