How to create a javascript to send a form to my email? [duplicate]

0

I contain the following HTML5 code:

<div class="form">

                    <div id="sendmessage">Sua mensagem foi enviada. Obrigado!</div>
                    <div id="errormessage"></div>
                    <form action="" method="post" role="form" class="contactForm" id="contactForm">
                        <div class="form-group">
                            <input type="text" name="name" class="form-control input-text" id="name" placeholder="Seu nome" data-rule="minlen:4" data-msg="Introduza pelo menos 4 caracteres" />
                            <div class="validation"></div>
                        </div>
                        <div class="form-group">
                            <input type="email" class="form-control input-text" name="email" id="email" placeholder="Seu email" data-rule="email" data-msg="Por favor digite um email válido" />
                            <div class="validation"></div>
                        </div>
                        <div class="form-group">
                            <input type="text" class="form-control input-text" name="subject" id="subject" placeholder="Assunto" data-rule="minlen:4" data-msg="Introduza pelo menos 8 caracteres do assunto" />
                            <div class="validation"></div>
                        </div>
                        <div class="form-group">
                            <textarea class="form-control input-text text-area" name="message" rows="5" data-rule="required" data-msg="Por favor, escreva algo para nós" placeholder="Mensagem"></textarea>
                            <div class="validation"></div>
                        </div>

                        <div class="text-center"><button type="submit" class="input-btn">Enviar Mensagem</button></div>
                    </form>
                </div>  

How to add a javascript to send me this information, and the messages indicated there appear?

    
asked by anonymous 06.02.2017 / 00:41

2 answers

1

If you just want to receive data from this form in your Email, I'll point out to you this ridiculously simple tool. link

<form action="https://formspree.io/**seuemail**" method="POST"> <input type="text" name="name"> <input type="email" name="_replyto"> <input type="submit" value="Send"> </form>

    
06.02.2017 / 00:55
0

To submit by javascript you can use smtpjs ( link ). On the site itself has the example of how to use and watch out for the security part that they have a tool to generate a token rather than you put their credentials openly in the code.

    
07.02.2017 / 01:51