Home Files
Adminer
Execute Command
PHP Eval
Symlink
File Upload
Owner :
www-data
PHP Version
5.6.40-0+deb8u12
Disk Space
41.05 GB
Server Addr
19-www4
Your IP
10.10.10.40
Edit File
File:
<?php require_once("admin/conexao/conecta.php"); // Inclui o arquivo class.phpmailer.php localizado na pasta phpmailer require("mail/PHPMailer/class.phpmailer.php"); // DEFINE O FUSO HORARIO COMO O HORARIO DE BRASILIA date_default_timezone_set('America/Cuiaba'); //Variáveis $nome = $_POST['nome']; $email = $_POST['email']; $telefone = $_POST['telefone']; $mensagem = $_POST['msg']; $data_envio = date('d/m/Y'); $hora_envio = date('H:i:s'); // Corpo E-mail $arquivo = " <style type='text/css'> body { margin:0px; font-family:Verdane; font-size:12px; color: #666666; } a{ color: #666666; text-decoration: none; } a:hover { color: #FF0000; text-decoration: none; } </style> <html> <table width='510' border='1' cellpadding='1' cellspacing='1' bgcolor='#CCCCCC'> <tr> <td> <tr> <td width='500'>Nome:$nome</td> </tr> <tr> <td width='320'>E-mail:<b>$email</b></td> </tr> <tr> <td width='320'>Telefone:<b>$telefone</b></td> </tr> <tr> <td width='320'>Mensagem:$mensagem</td> </tr> </td> </tr> <tr> <td>Este e-mail foi enviado em <b>$data_envio</b> às <b>$hora_envio</b></td> </tr> </table> </html> "; //RECUPERANDO DADOS $sql = "SELECT * from tb_email "; try { $resultado = $conexao->prepare($sql); $resultado->execute(); $contar = $resultado->rowCount(); if ($contar > 0) { while ($exibe = $resultado->fetch(PDO::FETCH_OBJ)) { $modal +=1; //DADOS E-MAIL $mail = new PHPMailer(true); $mail->isSMTP();// Set mailer to use SMTP $mail->CharSet = "utf-8";// set charset to utf8 $mail->SMTPAuth = true;// Enable SMTP authentication $mail->SMTPSecure = $exibe->protocolo;//'tls';// Enable TLS encryption, `ssl` also accepted $mail->Host = $exibe->smtp;//'smtp.live.com';// Specify main and backup SMTP servers $mail->Port = $exibe->porta;//587;// TCP port to connect to $mail->SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) ); $mail->isHTML(true);// Set email format to HTML $mail->Username = $exibe->email;//'leandromazurek@hotmail.com';// SMTP username $mail->Password = $exibe->senha;// SMTP password $mail->setFrom($exibe->email, 'GeoClimaMT');//Your application NAME and EMAIL $mail->Subject = 'Contato pelo site GeoClimaMT';//Message subject $mail->MsgHTML($arquivo);// Message body $mail->addAddress($exibe->email, 'GeoClimaMT');// Target email // Define os anexos (opcional) //$mail->AddAttachment("c:/temp/documento.pdf", "novo_nome.pdf"); // Insere um anexo }//while } else { echo '<li>Não existe email cadastrado no sistema</li>'; } } catch (PDOException $erro) { echo $erro; } // Envia o e-mail $enviado = $mail->send(); // Limpa os destinatários e os anexos $mail->ClearAllRecipients(); $mail->ClearAttachments(); // Exibe uma mensagem de resultado if ($enviado) { echo '<div class="alert alert-success"> <button type="button" class="close" data-dismiss="alert">×</button> <strong>E-mail enviado com Sucesso!</strong> Agradecemos pelo contato!. </div>'; } else { echo '<div class="alert alert-info"> <button type="button" class="close" data-dismiss="alert">×</button> <strong>Não foi possível enviar o e-mail!</strong> Informações do erro:'.$mail->ErrorInfo;' </div>'; } header("Location: index.php"); /* // Inicia a classe PHPMailer $mail = new PHPMailer(); // Define os dados do servidor e tipo de conexão // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->IsSMTP(); // Define que a mensagem será SMTP $mail->SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) ); $mail->Host = "smtp.live.net"; // Endereço do servidor SMTP $mail->SMTPAuth = true; // Usa autenticação SMTP? (opcional) //$mail->SMTPSecure = 'tls';// Tipo de encriptação que será usado na conexão SMTP $mail->Username = 'leandromazurek@hotmail.com'; // Usuário do servidor SMTP $mail->Password = 'leo153624'; // Senha do servidor SMTP // Define o remetente // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->From = "leandromazurek@hotmail.com"; // Seu e-mail $mail->FromName = "GEOCLIMAMT"; // Seu nome // Define os destinatário(s) // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->AddAddress($email, $nome); //$mail->AddAddress('ciclano@site.net'); //$mail->AddCC('ciclano@site.net', 'Ciclano'); // Copia //$mail->AddBCC('fulano@dominio.com.br', 'Fulano da Silva'); // Cópia Oculta // Define os dados técnicos da Mensagem // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->IsHTML(true); // Define que o e-mail será enviado como HTML //$mail->CharSet = 'iso-8859-1'; // Charset da mensagem (opcional) // Define a mensagem (Texto e Assunto) // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->Subject = "Contato pelo site GEOCLIMAMT"; // Assunto da mensagem $mail->Body = $arquivo; //$mail->AltBody = "Este é o corpo da mensagem de teste, em Texto Plano! \r\n :)"; // Define os anexos (opcional) // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= //$mail->AddAttachment("c:/temp/documento.pdf", "novo_nome.pdf"); // Insere um anexo // Envia o e-mail $enviado = $mail->Send(); // Limpa os destinatários e os anexos $mail->ClearAllRecipients(); $mail->ClearAttachments(); // Exibe uma mensagem de resultado if ($enviado) { echo "E-mail enviado com sucesso!"; } else { echo "Não foi possível enviar o e-mail.<br /><br />"; echo "<b>Informações do erro:</b> <br />" . $mail->ErrorInfo; }*/ /* //enviar // emails para quem será enviado o formulário $emailenviar = "leandromazurek@kroton.com.br"; $destino = $emailenviar; $assunto = "Contato pelo Site"; // É necessário indicar que o formato do e-mail é html $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: $nome <$email>'; //$headers .= "Bcc: $EmailPadrao\r\n"; $enviaremail = mail($destino, $assunto, $arquivo, $headers); if($enviaremail){ $mgm = "E-MAIL ENVIADO COM SUCESSO! <br> O link será enviado para o e-mail fornecido no formulário"; echo " <meta http-equiv='refresh' content='10;URL=contato.php'>"; } else { $mgm = "ERRO AO ENVIAR E-MAIL!"; echo ""; } */ ?>