Send form without using PHP or similar

2

I need my HTML FORM with Bootstrap to be sent. The problem is that I do not know anything about PHP. The functionality I need is to send a message to an email address. Just the data and a message that the customer wants to send. It will not go to any BD nor will it be used in another Form. A traditional contact page.

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

    
asked by anonymous 06.08.2015 / 20:09

3 answers

2

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

Here's 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 "action" form, referencing PHP code

<form action="enviaEmail.php"> ...
    
06.08.2015 / 21:03
4

You can use formspree .

No need for registration, no programming back / front-end . Just set some 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 GitHub project page shows some advanced options that can be included in the form to customize the way it will be submitted to the recipient.

An 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>
    
02.08.2016 / 21:51
2

First, every language is dynamic.

What you probably meant is "language running on server side".

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

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 must have an email client installed and configured.

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

For Windows users, for example, the user probably has Live Mail or Outlook Express on the screen, however, with no configuration. You will probably click to send and you will think that the message has even been sent. The same goes for any other operating systems.

Forms submission services

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

    
06.08.2015 / 21:03