What you want to do is not possible on the client’s side. According to own documentation of the element <form>
:
The HTML element <form>
represents a section of a document that contains interactive controls that allow the user to submit information to a particular web server.
Thus, taking into account that email servers are not, in fact, "web servers", it is not possible to send data to them. Usually e-mail servers use other protocols, such as SMTP, other than the protocols used by the web.
The most you can do is use the protocol mailto
, which usually opens the operating system’s default email client with the already-defined fields:
<form method="get" action="mailto:[email protected]">
<input name="subject" placeholder="Assunto" />
<textarea name="body" placeholder="Mensagem"></textarea>
<button type="submit">Enviar</button>
</form>
Note that this will not "send" the email, just open the default system client. To learn more how this protocol works in the element <form>
, see the specification.
Thank you so much for your help friend.
– Laurêneo Machado