-
Notifications
You must be signed in to change notification settings - Fork 1
/
mailer.php
50 lines (37 loc) · 1.49 KB
/
mailer.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
<?php
$q= "select * from stud_reg";
$sql=mysql_query($q);
$result=mysql_fetch_array($sql);
$gu=$result["guide"];
if($_POST['submit']=="submit")
{
require ('class.phpmailer.php');
require ('class.smtp.php');
require 'PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'smtp.gmail.com'; // Specify main and backup server
// debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'war5625som'; // SMTP password
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$e=$result["l_email"];
$mail->From = '[email protected]';
$mail->FromName = 'SPAM Support';
$mail->addAddress($e); // Add a recipient
$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->IsHTML(true); // Set email format to HTML
$mail->Subject = 'Regarding Report';
$mail->Body = 'Dear Students, <br> <br> Here by you are inform that your synopsis has not been submitted yet.<br> so kindly submit you synopsis before last date.<br></br>From<br>'.$gu.'</br>';
$mail->AltBody = '';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
else
echo "<script>alert('Mail has been send');window.location.href='guide_page2.php';</script>";
}
?>