0
Well, the thing is, I created a form to send a quote from my client to my client using the site, but do not click the "send" button anything happens and I do not understand why. I’ll leave the HTML and PHP here in the description, there goes:
HTML:
<form name="orcamento" action="mail.php">
<div id="form-main">
<div id="form-div">
<form class="form" id="form1" method="POST" action="mail.php">
<p class="name">
<input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="Nome" id="name" />
</p>
<p class="email">
<input name="email" type="text" class="validate[required,custom[email]] feedback-input" id="email" placeholder="Email" />
</p>
<p class="phone">
<input name="tel" type="text" class="validate[required,custom[email]] feedback-input" id="phone" placeholder="Telefone (Com DDD)" />
</p>
<p class="text">
<textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="Produtos"></textarea>
</p>
<div class="submit">
<button class="g-recaptcha" data-sitekey="6LdIgR4UAAAAALrbj6sHWoRU6v9zZgDXp71MXQiX" data-callback='onSubmit' name="enviar" type="submit" id="button-blue" formmethod="POST"> ENVIAR </button>
<div class="ease"></div>
<div class="g-recaptcha"
data-sitekey="6LdIgR4UAAAAALrbj6sHWoRU6v9zZgDXp71MXQiX"
data-callback="onSubmit"
data-size="invisible">
</div>
</div>
</form>
</div>
</form>
PHP:
<?php
if($_POST['name'] & $_POST['text'] & $_POST['tel'] != ''){
include "classes/class.phpmailer.php";
$GetPost = filter_input_array(INPUT_POST,FILTER_DEFAULT);
$mensagem = "<html><head><center><img src=\"image/logo-grande.png\"></center></head><body style=\"background-color:#FFF;font-family:Segoe UI;font-site:14px;color:#000;\">
<br /><br />
<b>Contato Site ".Config::tituloSite()."</b>
<br /><br />
<hr style=\"width:100%;border:1px solid #3399CC\" /><br />
<b>Nome:</b> ".$_POST['name']."<br /><br />
<b>E-mail:</b> ".$_POST['email']."<br /><br />
<b>Telefone:</b> ".$_POST['tel']."<br /><br />
<b>Mensagem:</b> ".nl2br($_POST['text'])."<br /><br />
<hr style=\"width:100%;border:1px solid #3399CC\" />
</body></html>";
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Charset = "UTF-8";
$mail->SMTPSecure = 'ssl';
$mail->Host = 'mail.madeireirapadroeira.com.br'; // Endereço do servidor SMTP (Autenticação, utilize o host smtp.seudomínio.com.br)
$mail->SMTPAuth = true; // Usar autenticação SMTP (obrigatório para smtp.seudomínio.com.br)
$mail->Port = 587; // Usar 587 porta SMTP
$mail->Username = '[email protected]'; // Usuário do servidor SMTP (endereço de email)
$mail->Password = 'SENHA'; // Senha do servidor SMTP (senha do email usado)
//Define o remetente
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
$mail->From = '[email protected]';
$mail->FromName = "ORÇAMENTO-SITE";
//Define os destinatário(s)
$mail->AddAddress('[email protected]');
$mail->IsHTML(true);
$mail->Subject = "Contato pelo site - {$_POST['name']}".date("H:i")." - ".date("d/m/Y");
$mail->Body = $mensagem;
if($mail->Send()){
echo 'E-mail enviado com sucesso!';
}
else{
echo 'Houve algum erro no envio. Tente novamente!'; .$mail->ErrorInfo;
}
}?>
what are two Forms <form name="orcging" action="mail.php">
– user60252
It was for testing but it makes no difference with or without
– João Rocha
is working now? you received an email I made here for testing with your corrected code?
– user60252
Yes, I did, Leo, but in the test I did right on the website, no, I just did, two minutes ago
– João Rocha
Uai, but Guilherme Nascimento’s answer is marked as accepted, so I thought I’d got it right.
– user60252
Dei accepted because the && error was not what I was asking
– João Rocha