-
Notifications
You must be signed in to change notification settings - Fork 0
/
verifymail.php
93 lines (80 loc) · 2.72 KB
/
verifymail.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
<?php
include 'connection.php';
session_start();
$stid=$_GET['artid'];
$sql2="UPDATE `stud_reg` SET `status`='approved' WHERE `stid`='$stid'";
$ap=mysqli_query($connection,"SELECT * from `stud_reg` WHERE `stid`='$stid'");
// Import PHPMailer classes into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'PHPMailer/Exception.php';
require 'PHPMailer/PHPMailer.php';
require 'PHPMailer/SMTP.php';
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '<Senders email address>'; // SMTP username
$mail->Password = '<Emailpassword>'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
// Sender info
$mail->setFrom('[email protected]', 'E-Magazine');
$mail->addReplyTo('[email protected]', 'E-Magazine');
while($rw = mysqli_fetch_array($ap))
{
$emailId=$rw['email'];
$name=$rw['firstname'];
$pswd=$rw['password'];
}
// Add a recipient
$mail->addAddress($emailId);
//$mail->addCC('[email protected]');
//$mail->addBCC('[email protected]');
// Set email format to HTML
$mail->isHTML(true);
// Mail subject
$mail->Subject = 'Email from E-Magazine System';
// Mail body content
$bodyContent .= '<html>
<head>
<meta charset="utf-8">
</head>
<body background="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS4hVvyxHSVWVWGu8Uqq1bOi0x7KAhUG22svA&usqp=CAU" style="background-size: cover;">
<center>
<h1 style="margin-top: 50px;">Welcome to <b style="color:crimson;">E-Magazine System</b></h1>
<p>Hai '.$name.',</p>
<p>Your account opening is Complete.. (Let us have some cheers for that)</p>
Now you can Upload your works and also View the completed works of your Friends.. <br>
Below are your credentials to access the website. Enjoy using our Website
<table border="1" style="margin-top:30px">
<tr>
<th scope="row">Mail From</th>
<td>E-Magazine Admin</td>
</tr>
<tr>
<th scope="row">Username</th>
<td>'.$emailId.'</td>
</tr>
<tr>
<th scope="row">Password</th>
<td>'.$pswd.'</td>
</tr>
</table>
<div style="margin-top:30px">
Explore from here--->> <a href="localhost\magazine\index1.html"> E-Magazine Website</a></div>
</center>
</body>
</html>';
$mail->Body = $bodyContent;
// Send email
if(!$mail->send()) {
echo 'Message could not be sent. Mailer Error: '.$mail->ErrorInfo;
} else {
echo 'Message has been sent.';
}
if(mysqli_query($connection,$sql2))
{
header("location:Vdashboard.php");
}
?>