是否可以在提交按钮上实现mailto:
功能,例如<input type="submit" />
?我使用ASP.NET MVC。也许有一些棘手的 Controller Action 结果可以实现这一点。请你帮助我好吗?
附言我知道我可以使 anchor 看起来像一个按钮。
最佳答案
在HTML中,您可以在mailto:
元素的<form>
属性中指定[action]
地址。
<form action="mailto:[email protected]" method="GET">
<input name="subject" type="text" />
<textarea name="body"></textarea>
<input type="submit" value="Send" />
</form>
这将允许用户的电子邮件客户端创建预先填充了
<form>
中的字段的电子邮件。这将不会发送电子邮件。
关于html - Mailto on Submit按钮,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12626940/