$telefone = $_POST['telefone']; $assunto = $_POST['assunto']; $mensagem = $_POST['mensagem']; require_once "PHPMailer-master/PHPMailerAutoload.php"; $mail = new Phpmailer(); $mail->issmtp(); $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = "******"; $mail->Password = "******"; $mail->setFrom("*****@*****.**", "Email de Contato do Site"); $mail->addAddress("*****@*****.**"); $mail->Subject = "Email de contato do Site"; $mail->msgHTML("<html>de: {$nome}<br/>email: {$email}<br/>Fone: {$telefone}<br>Assunto: {$assunto}<br>Mensagem: {$mensagem}</html>"); if ($mail->send()) { ?> <script> alert("Mensagem Enviada com Sucesso!!!"); window.location = "contato.php"; </script>'; <?php } else {
$modelo = $_POST['modelo']; $ano = $_POST['ano']; $seguradora = $_POST['seguradora']; $anexo = $_FILES['anexo']; $obs = $_POST['obs']; require_once "PHPMailer-master/PHPMailerAutoload.php"; $mail = new Phpmailer(); $mail->issmtp(); $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = "******"; $mail->Password = "******"; $mail->setFrom("*****@*****.**", "Email de Contato do Site"); $mail->addAddress("*****@*****.**"); $mail->Subject = "Email de contato do Site"; $mail->msgHTML("<html><strong>Cliente: {$nome}<br/>Endereço: {$endereco}<br>Bairro: {$bairro}<br>Cidade: {$cidade}<br>Celular: {$celular}<br>Telefone: {$telefone}<br>email: {$email}<br/>Marca: {$marca}<br> Modelo: {$modelo}<br>Ano: {$ano}<br>Seguradora: {$seguradora}<br>Observações: {$obs}</strong></html>"); $mail->AddAttachment($anexo['tmp_name'], $anexo['name']); if ($mail->send()) { ?> <script>alert("Orcamento Enviado com Sucesso!!!\nEm Breve Retornaremos o seu contato.\nObrigado pela Preferencia"); window.location = "orcamento.php";</script>'; <?php } else { echo "Erro ao enviar mensagem " . $mail->ErrorInfo; header("Location: contato.php"); } die;