Submit form without using PHP or similar

I need my HTML form with Bootstrap to be submitted. The problem is that I don't know anything about PHP. The functionality I need is to send a message to an email address. Only the data and a message that the client wants to send. It does not go to any database nor will it be used in another Form. A traditional Contact page.

Is there any way I can submit my FORM, without having to use a dynamic language?

Author: Guilherme Nascimento, 2015-08-06

3 answers

To send an email form only with some programming language. In PHP it is quite simple, look for the mail () function;

Follows an example:

   <?php

       $para = "[email protected]"; 

       $nome = $_POST['ID_CAMPO_HTML_NOME']; //valor digitado no campo Nome
       $assunto = $_POST['ID_CAMPO_HTML_ASSUNTO']; //valor digitado no campo Assunto
       $mensagem = "<strong>Nome: </strong>".$nome; 
       $mensagem .= "<br> <strong>Mensagem:  
       </strong>".$_POST['ID_CAMPO_HTML_MENSAGEM']; //valor digitado no campo Mensagem


    //CODIFICAÇÕES CORRETAS PARA O FORMATO DO E-MAIL
       $headers = "Content-Type:text/html; charset=UTF-8\n";
       $headers .= "From: dominio.com.br<[email protected]>\n"; 
       $headers .= "X-Sender: <[email protected]>\n";
       $headers .= "X-Mailer: PHP v".phpversion()."\n"; 
       $headers .= "X-IP: ".$_SERVER['REMOTE_ADDR']."\n";
       $headers .= "Return-Path: <[email protected]>\n"; 
       $headers .= "MIME-Version: 1.0\n";

    mail($para, $assunto, $mensagem, $headers); 

    ?>

Use the form's "action", referencing to the PHP code

<form action="enviaEmail.php"> ...
 3
Author: mauricio caserta, 2015-08-06 19:03:37

You can use the formspree.

No registration required, no programming required back/front-end. Just set a few parameters in the Form:

<form action="https://formspree.io/[email protected]" method="POST">
    <input type="text" name="mensagem">
    <input type="submit">Enviar</button>
</form>

The value after https://formspree.io/ is the email to which the form information will be sent.

The project page on GitHub shows some advanced options parameters that can be included in the form, to customize how it will be submitted to the recipient.

Um example containing a predefined title and an email (chosen by the user) to which a response should be sent:

<form action='https://formspree.io/[email protected]' method='post'>

  <!-- Título/Assunto do Email. -->
  <input type='hidden' name='_subject' value='Contato de Cliente'>

  <!-- Email de Resposta. -->
  <input type='email' name='_replyto' placeholder='Email p/ contato'>

  <!-- Mensagem que será submetida. -->
  <textarea name='mensagem'></textarea>

  <button type='submit'>Enviar</button>
</form>
 5
Author: Renan Gomes, 2016-08-18 01:57:48

First, every language is dynamic.

What you probably meant is "language that runs on server side".

A simple way to solve your question is to use HTML "mailto".

Example:

<a href='mailto:[email protected]?subject=Assunto&body=conteúdo'>Enviar email</a>

Example with <form>

<FORM Action="mailto:[email protected]?Subject=Assunto" METHOD="POST">
    mailto: protocol test:
    <br />Assunto 
    <INPUT name="Subject" value="Test Subject">
    <br  />Mensagem
    <TEXTAREA name="Body">
    lorem ipsum
    </TEXTAREA>
    <br />
    <INPUT type="submit" value="Submit"> 
</FORM>

Disadvantage

The user needs to have an email client installed and configured.

The vast majority of people do not because they use webmail services or messengers like facebook messenger, twitter, Hotmail, yahoo, among others.

For Windows users, for example, the user will probably have Live Mail or Outlook Express on the screen, however, without configuration. You will probably click to send and you will be left thinking that the message was actually sent. The same goes for any other operating systems.

Form Submission Services

Another means is to use third-party services. There are several services that provide a URL for "action" of " <form>".

 2
Author: Daniel Omine, 2015-08-06 19:03:13