-2
I created an email form, it’s functional. I just wish I knew how to return the message echo('Email enviado com sucesso'). Inside my html index.
For example:
<form method="POST" action="./email.php">
<label>Digite seu nome:
<input id="name" type="text" name="name" value="" placeholder="Nome" required>
</label>
<input id="btn_enviar_email" class="send" type="submit">Enviar</input>
When submitting logically opens on a new page with the email message sent. I would like to return this value and treat within my index. In this case, without opening a new guide to this.

To not leave the page change the
<input type="submit">by a<input type="button">with the eventonClickpointed to a function that makes a request orJQuery.ajaxorXMLHttpRequestdirected toemail.phpwith the email data. To handle the messages just seeing the php code to give an opinion.– Augusto Vasques