-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmail_card.php
40 lines (32 loc) · 910 Bytes
/
mail_card.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
<?php
include('session.php');
require_once('../PHPMailer_5.2.0/class.phpmailer.php');
$mail = new PHPMailer();
$email_to=$login_session;
$mail->IsSMTP();
$mail->CharSet="UTF-8";
$mail->SMTPSecure = 'tls';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->Username = '[email protected]';
$mail->Password = 'narcosseason3';
$mail->SMTPAuth = true;
$mail->From = ('[email protected]');
$mail->FromName = 'Admin Central Blood Bank';
$address=$email_to;
$mail->AddAddress($address);
$mail->AddReplyTo('[email protected]', 'Mail sent successfully');
$mail->IsHTML(true);
$mail->Subject = 'Donor Card';
$mail->MsgHTML(file_get_contents('donorcard.php'));
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->Body = $body;
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message sent!";
}
?>