-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend_link.php
More file actions
53 lines (51 loc) · 1.67 KB
/
Copy pathsend_link.php
File metadata and controls
53 lines (51 loc) · 1.67 KB
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
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
ob_start();
session_start();
if (null !== (filter_input(INPUT_POST, 'submit_email')) && filter_input(INPUT_POST, 'email'))
{
include_once 'dbConfig.php';
$select=mysql_query("select id,email,password from applicants where id=".$_SESSION['users']);
if(mysql_num_rows($select)==1)
{
while($row=mysql_fetch_array($select))
{
$email=md5($row['email']);
$pass=md5($row['password']);
}
$link="<a href='www.todo-list.byethost13.com/reset.php?key=".$email."&reset=".$pass."'>Click To Reset password</a>";
require_once('phpmail/PHPMailerAutoload.php');
$mail = new PHPMailer();
$mail->CharSet = "utf-8";
$mail->IsSMTP();
// enable SMTP authentication
$mail->SMTPAuth = true;
// GMAIL username
$mail->Username = "sunumacbright@gmail.com";
// GMAIL password
$mail->Password = "Etornam1994,,";
$mail->SMTPSecure = "ssl";
// sets GMAIL as the SMTP server
$mail->Host = "smtp.gmail.com";
// set the SMTP port for the GMAIL server
$mail->Port = "465";
$mail->From='sunumacbright@gmail.com';
$mail->FromName='Sunu Bright';
$mail->AddAddress('reciever_email_id', 'reciever_name');
$mail->Subject = 'Reset Password';
$mail->IsHTML(true);
$mail->Body = 'Click On This Link to Reset Password '.$pass.'';
if($mail->Send())
{
echo "Check Your Email and Click on the link sent to your email";
}
else
{
echo "Mail Error - >".$mail->ErrorInfo;
}
}
}