Adding content to an input field before sending it
var pegarTxt = document.getElementById("Total").innerText;
//para textarea
document.getElementById('TotalFinaliz').value = pegarTxt;
document.getElementById('TotalFinaliz2').innerText = pegarTxt;
document.getElementById('TotalFinaliz3').innerHTML = pegarTxt;
var pegarTxt = document.querySelector('div').textContent;
document.getElementById('TotalFinaliz4').innerHTML = pegarTxt;
//para input somente .value
document.getElementById('TotalFinaliz5').value = pegarTxt;
<div id="Total">Entou necessitando pegar o conteudo de uma div para minha varivel para que eu possa tratar ela e fazer meu envio de email</div>
<textarea id="TotalFinaliz"></textarea>
<textarea id="TotalFinaliz2"></textarea>
<textarea id="TotalFinaliz3"></textarea>
<textarea id="TotalFinaliz4"></textarea>
<input id="TotalFinaliz5">
var pegarTxt = document.getElementById("Total").innerText;
//no textarea de indice 2
document.getElementsByClassName("RonaldoM")[2].innerText = pegarTxt;
<textarea class="RonaldoM"></textarea>
<textarea class="RonaldoM"></textarea>
<textarea class="RonaldoM"></textarea>
<div id="Total">Entou necessitando pegar o conteudo de uma div para minha varivel para que eu possa tratar ela e fazer meu envio de email</div>
There are many servers that do not allow the file_get_contents () function to be used. For these cases, you can put some external page in a variable using the cURL library.
$ch = curl_init();
$timeout = 0;
curl_setopt($ch, CURLOPT_URL, 'http://exemplo.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$conteudo = curl_exec ($ch);
curl_close($ch);
O conteúdo da página estará na variável $conteudo.
file_get_contents
has the purpose of reading files, and by chance also accessing Urls, since the cURL library is intended for a direct connection to a web page, whether it is internal to your domain, or even external. So for this reason I believe it's best to use cUrl
Difference between file_get_contents and curl