I've been looking for this problem here in the forum, but I have not found it. If there is a link and someone can send me, I am grateful. The problem is this:
This my form, sends 2 emails to the recipient that I set. I looked at the code again and again, but I did not understand why.
PHP
$nome = $_POST['nome'];
$texto = $_POST['texto'];
$enviar= $_POST['enviar'];
if(isset($enviar)){
$corpoMSG = "Oi, meu nome é: ".$nome."<br /><br />".$texto;
$assunto = "Teste para envio de email";
require_once('phpmailer/class.phpmailer.php');
$mail = new PHPMailer();
$mail->CharSet = 'UTF-8';
$mail->SetFrom('[email protected]', 'Orçamento');
$address = "[email protected]";
$mail->AddAddress($address, "destinatario");
$mail->Subject = $assunto;
$mail->MsgHTML($corpoMSG);
if(!$mail->Send()) {
echo "<div class='alert alert-danger'><p style='padding: 0; margin: 0;'>Email não enviado.</p></div>";
} else {
echo "<div class='alert alert-success'><p style='padding: 0; margin: 0;'>
Email enviado com sucesso!</p></div>"; }}