How to email content written in a textarea / textarea?

-1

I would like to know, if there is a script, a way to send the content contained in the textarea to an email. Thanks in advance!

    
asked by anonymous 19.07.2017 / 02:29

1 answer

0

You can get the value of <textarea> by method POST of Form , example:

<form method="post" action="query.php">
    <textarea name="texto"></textarea>
    <input type="submit" />
</form>

And then pick up with $_POST of php:

$conteudo = $_POST['texto'];

And send the email normally:

mail($destinatario, $assunto, $conteudo, "From: [email protected]");
//Onde a variavel $assunto contem o assunto do email e $destinatario, pra quem o email será enviado

Do not forget to set php.ini !

See this , if you have more questions. Or official documentation .

    
19.07.2017 / 02:35