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
108
109
110
111
|
<?php include ("_private/conectar.php"); $nome = utf8_decode ($_POST["nome"]); $email = utf8_decode ($_POST["email"]); $fone = utf8_decode ($_POST['fone']); $assunto = utf8_decode ($_POST['assunto']); $cpf6 = utf8_decode ($_POST['cpf6']); //$setor = utf8_decode ($_POST['setor']); $mensagem = utf8_decode (nl2br($_POST["mensagem"])); // Verifica se o nome foi preenchido
$str = $cpf6; $cpf = preg_replace( '#[^0-9]#', '', $str );
$query = mysql_query ("select nome,senha,email from curriculo where cpf = '$cpf'"); $total = mysql_num_rows($query);
$ln = mysql_fetch_assoc($query); $senha = $ln['senha']; $nome = $ln['nome']; $email = $ln['email'];
// enviar e-mail // function enviar(){ global $cpf6; global $nome; global $senha; global $email; global $assunto; //global $setor; global $mensagem; global $total;
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.sivana.com.br"; $mail->Port = 587; $mail->Username = "webmaster@sivana.com.br"; $mail->Password = "09sivana"; $mail->From = "webmaster@sivana.com.br"; $mail->FromName = "Site Sivana"; //$mail->AddReplyTo("grasiele@costamiquelin.com.br","grasiele"); $mail->IsHTML(true); // send as HTML
$mail->Subject = "Recuperar Senha - SIVANA!"; $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 colspan='2' align='center'><strong><font size='2' face='Arial, Helvetica, sans-serif'>..:: SIVANA - Recuperar Senha ::..</font></strong></td> </tr> <tr> <td colspan='2'><hr /></td> </tr> <tr> <td width='100' colspan='2'><div align='right'><strong><font size='2' face='Arial, Helvetica, sans-serif'>Olá $nome sua senha de acesso ao banco de talentos do Portal do Sivana <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("alisson@gmcriacoes.com.br"); // $mail->AddAddress($departamento); $mail->AddBcc($email); if ($total == 0) { echo '<br>Registro não encontrado, verifique se o CPF esta correto <br> Caso não tenha registro no site cadastre-se é grátis '; } else if(!$mail->Send()) { echo "Ocorreu um erro durante o envio do email."; } else { echo false; } } //fim email //
enviar(); echo false; // Se houver algum erro ao inserir
?>
|