/var/www/vhosts/sivana.com.br/httpdocs/area-associado/recuperar-submissao.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
include_once("../_private/conectar.php");


$email utf8_decode ($_POST["email"]);


// enviar e-mail //
function enviar($email,$nome,$senha){

include(
"../mail/class.phpmailer.php");
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded



        
$mail             = new PHPMailer();
        
        
//$body             = $mail->getFile('contents.html');
        //$body             = eregi_replace("[\]",'',$body);
        
        
$mail->IsSMTP();
        
$mail->SMTPAuth   true;                  // enable SMTP authentication
        
$mail->SMTPSecure "ssl";                 // sets the prefix to the servier
        
$mail->Host       "smtp.gmail.com";      
        
$mail->Port       465;                   
        
        
$mail->Username   "contato@gmcriacoes.com.br";  
        
$mail->Password   "gracris12";            
        
                
        
$mail->From       "webmaster@fecea.com.br";
        
$mail->FromName   "Ecopar";

        
//$mail->AddReplyTo("grasiele@costamiquelin.com.br","grasiele");
        

        
$mail->Subject    "Lembrete de Senha - ECOPAR!";
        
        
$body       "
        <html>
        <head>
        <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
        </head>
        <body>
        <table width='500' border='0' cellspacing='1' cellpadding='1'>
              <tr>
                <td align='center'><strong><font size='2' face='Arial, Helvetica, sans-serif'>..:: ECOPAR - Lembrete de Senha ::..</font></strong></td>
              </tr>
              <tr>
                <td ><hr /></td>
                </tr>
              <tr>
                <td ><div align='left'><font size='2' face='Arial, Helvetica, sans-serif'><strong>
$nome</strong> sua senha foi solicitada em nosso site!</font></div></td>
                </font></td>
              </tr>
              
              <tr>
                <td><div align='left'><strong><font size='2' face='Arial, Helvetica, sans-serif'>Sua senha: <strong>
$senha</strong></font></strong></div></td>
              </tr>
              
            </table>
        </body>
        </html>
        "
;                      //HTML Body
        //$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
        //$mail->WordWrap   = 50; // set word wrap
        
        
$mail->MsgHTML($body);
        
        
$mail->AddAddress($email);
        
        if(!
$mail->Send()) {
          echo 
"Ocorreu um erro durante o envio do email.";
         } else {
            echo 
false;
            
        }
}
//fim email //    

if (!preg_match("/^[a-z0-9_\.\-]+@[a-z0-9_\.\-]*[a-z0-9_\-]+\.[a-z]{2,4}$/i",  $email)) {
    echo 
'<div class="alert-warning">Informe um e-mail valido</div>';


// Se nALo houver nenhum erro
else {
    
    
$sql_1 mysql_query("select email, senha, nome from associado where email='$email' and publicado='s'") or die ("Erro ao buscar informaƧoes");
   
$cont mysql_num_rows($sql_1);

   if (
$cont 0){
   
$row mysql_fetch_assoc($sql_1);


        
enviar($row['email'],$row['nome'],$row['senha']);
        
        
        echo 
false;
   }else{
    echo 
'Este email nao consta em nossos registros!';
   }
    
// Se houver algum erro ao inserir
    
}

?>