Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $nome = utf8_decode (strip_tags(trim($_POST['nomeremetente'])));
- $email = utf8_decode (strip_tags(trim($_POST['emailremetente'])));
- $tel = utf8_decode (strip_tags(trim($_POST['tel'])));
- $cpf = utf8_decode (strip_tags(trim($_POST['cpf'])));
- $num = utf8_decode (strip_tags(trim($_POST['num'])));
- $cep = utf8_decode (strip_tags(trim($_POST['cep'])));
- require_once('PHPMailer/class.phpmailer.php');
- $path = $_POST['path'];
- $filename = $_POST['filename'];
- $newpath = "fotos/".$path;
- $Email = new PHPMailer();
- $Email->SetLanguage("br");
- $Email->IsSMTP(); // Habilita o SMTP
- $Email->SMTPAuth = true; //Ativa e-mail autenticado
- $Email->Host = '**********************'; // Servidor de envio # verificar qual o host correto com a hospedagem as vezes fica como smtp.
- $Email->Port = '***'; // Porta de envio
- $Email->Username = '**********************'; //e-mail que será autenticado
- $Email->Password = '**********************'; // senha do email
- // ativa o envio de e-mails em HTML, se false, desativa.
- $Email->IsHTML(true);
- // email do remetente da mensagem
- $Email->From = '**********************';
- // nome do remetente do email
- $Email->FromName = utf8_decode($email);
- // Endereço de destino do emaail, ou seja, pra onde você quer que a mensagem do formulário vá?
- $Email->AddReplyTo($email, $nome);
- $Email->AddAddress("**********************"); // para quem será enviada a mensagem
- $Email->AddAddress("**********************");
- $Email->AddAddress("**********************");
- // informando no email, o assunto da mensagem
- $Email->Subject = "Contrato "****** *******" - $nome";
- $Email->AddAttachment($newpath);
- // Define o texto da mensagem (aceita HTML)
- $Email->Body = "
- <html>
- <head>
- <title>Pré Contrato</title>
- </head>
- <body>
- <table>
- <p>Virtu@lnet Telecom Contrato</p>
- Nome:<strong> $nome</strong><br>
- E-mail:<strong> $email</strong><br>
- Celular/Telefone:<strong> $tel</strong><br>
- CPF:<strong> $cpf</strong><br>
- RG:<strong> $num</strong><br>
- CEP:<strong> $cep</strong><br>
- </table>
- </body>
- </html>";
- // verifica se está tudo ok com oa parametros acima, se nao, avisa do erro. Se sim, envia.
- if(!$Email->Send()){
- echo "<p>A mensagem não foi enviada. </p>";
- echo "Erro: " . $Email->ErrorInfo;
- }else{
- echo "
- <html>
- <div class='alert alert-success' role='alert'>
- <h4 class='alert-heading'>Well Done!</h4>
- <p>Email enviado para central da Virtu@lnet Telecom será respondido em 2 dias uteis vamos analisar os documentos e vamos entrar em contato.</p>
- <hr>
- <p class='mb-0'>Atendemos somente em sapucaia do sul</p>
- </div>
- </html>";
- echo "<html> <div class='alert alert-warning alert-dismissible fade show' role='alert'>
- <strong>Aviso:</strong> Contrato so vai ser valido se todas informações tiverem corretas.
- <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
- <span aria-hidden='true'>×</span>
- </button>
- </div> </html>";
- }
Add Comment
Please, Sign In to add comment