How do I send these form fields via email via PHP?

Asked

Viewed 35 times

-1

I got a ready-made website that has over 3,000 pages and many of them have a quote form. The problem is that the form action sends the data to an URL without extension.

<form action="http://www.benicorte.com.br/fabricacao-de-moveis/enviar-cotacao" id="formulario-cotacao" method="post">
    <input type="hidden" name="acao" value="cotacao">
    <input type="hidden" name="produto_nome" value="">
    <input class="url-atual" type="hidden" name="produto_url" value="">
    <input class="url-atual" type="hidden" name="produto_ref" value="">
    <input type="hidden" name="imagem" value=""/>
    <input type="hidden" name="site" value="index.html"/>
    <input type="hidden" name="email" value="[email protected]"/>
            <input type="hidden" name="projeto" value="2455"/>

    <div class="item-form" id="campos-formulario">
        <p><label>Nome:&nbsp; <input type="text" name="nome"></label></p>
        <p class="error-message" id="erro_nome"></p>
        <p><label>Email:&nbsp; <input type="email" name="email_contato"></label></p>
        <p class="error-message" id="erro_email_contato"></p>
        <p><label>Telefone:&nbsp; <input type="text" name="telefone" class="telefone"></label></p>
        <p class="error-message" id="erro_telefone"></p>

        <p class="error-message" id="erro_palavra"></p>
    </div>
    
    <div class="item-form" id="mensagem-formulario">
        <p><label>Mensagem:&nbsp; <textarea name="mensagem"></textarea></label></p>
        <p class="error-message" id="erro_mensagem"></p>
    </div>
    <div class="clear"></div>
    
    <div class="cta-formulario">
        <div class="seguranca-cta-formulario">
           <div class="item-cta">
                              <div class="g-recaptcha"
                 data-sitekey="0000000000000000"></div>
                                   </div>
            <div class="item-cta">
                <button type="button" id="btn-enviar-cotacao" class="btn-verde">Enviar cotação</button>            
                <img src="../imagens/ajax-loader.html" class="image-loading" id="loader-ajax" alt="Aguarde..." title="Aguarde..." style="display:none">
            </div>
        </div>
    </div>
    
    

</form>

Could someone explain to me how to send these form fields by email through PHP?

  • I don’t know what that’s about ...The problem is that the form action sends the data to an URL without extension... worries you, maybe that How can I simplify Urls for a website? or this What is REST and Restful? help you. And as for the email see mail() and also see Phpmailer

  • 1

    Complementing the @Augustovasques reply: the form you see can send the completed data to a back-end (in this case what is behind the route http://www.benicorte.com.br/fabricacao-de-moveis/enviar-cotacao) and there you can receive the data and use mail to send them by e-mail.

No answers

Browser other questions tagged

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