将 mailto 的收件人更改为在文本字段中输入的内容

Changing the recipient of the mailto to what is entered in the text field

我想知道是否可以制作一个表单,其中可以将设置了 mailto 操作的电子邮件更改为在文本字段中输入的内容。

例如:

<form enctype="text/plain" method="get" action="mailto:getElementByName='friend1'" action="cc:manager@crill.com">
Friend 1 <input type="text" name="friend1"><br>
Friend 2 <input type="text" name="friend2"><br>
Friend 3 <input type="text" name="friend3"><br>

<input type="submit" value="Send">
</form> 

因此,如果在名为 "Friend 1" 的第一个字段中输入:"example1@mail.com",那么当我按下提交时,我希望它获取放置在第一个字段中的信息并将其设为邮寄地址。

我为我的英语道歉,希望读过这篇文章的人能理解。 提前谢谢你。

您可以使用:

<form method="post" action="javascript:;" onSubmit="this.action='mailto:'+document.getElementById('friend1').value;" enctype...>

也在这里检查:Is it possible to dynamically set the recipient of MAILTO: with only HTML and JavaScript?