Contact form on an intitucional website

Asked

Viewed 57 times

0

What is the best way to insert a functional form with text input, multiple choice selection etc on a static site (I don’t intend to use php).

I know how the process of building and shipping works, what I would really like to know is if there is a solution that does not use the language of Prog

  • You cannot send a form without using any language backend.

  • Answer: no! You can’t do that. Obviously that wouldn’t be safe, because you’d have to expose your email server on the internet, with the authentication and everything. So, use a programming language to send email.

  • I don’t know if the right Pq never tried, but sometimes you can get a third party sending system, like a sending service that you will use on your site as an iframe with the form of another website or sending service

  • If you do not want to put your hand in the codes, recommend using Wordpress... At least you can do something more "powerful" like send emails and more, without having to program.

1 answer

0

It is a little mistaken to say that it is impossible to send a form without a backend... It’s just not practical and depends on features on the user’s machine, like a configured email client.

The example below is just a demonstration of this and is very bad practice. It wouldn’t be much different than providing a link to the email, which in fact would be the most recommended if you don’t want to have a backend.

<form method="GET" action="mailto:[email protected]">
    <b>Assunto:</b>
    <br/>
    <input type="text" name="subject" />
    <br/>
    <b>Mensagem:</b>
    <br/>
    <textarea name="body"></textarea>
    <br/>
    <input type="submit" value="Enviar" />
</form>

  • In this case, sending is not done by the Front-End, but by a third party program. I think it does not fit.

  • @Leandrocastro, if it fits... this is the only way you can submit a form and send an email exclusively on the frontend (only with resources available on the client side). Although it is a practice that has been widely used in the past, it is a bad solution and should not be applied.

  • What could be done, is the integration with some Web API for sending... but this is not to solve only on the front but to use the backend service of some third party

Browser other questions tagged

You are not signed in. Login or sign up in order to post.