-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.php
51 lines (41 loc) · 1.21 KB
/
config.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
<?php
$server = "localhost";
$user = "root";
$pass = "";
$database = "car";
$conn = mysqli_connect($server, $user, $pass, $database);
define('SERVER_PATH',$_SERVER['DOCUMENT_ROOT'].'/car/');
define('SITE_PATH','http://localhost/car/');
define('CAR_IMAGE_SERVER_PATH',SERVER_PATH.'admin/assets/images/');
define('CAR_IMAGE_SITE_PATH',SITE_PATH.'admin/assets/images/');
if (!$conn) {
die("<script>alert('Connection Failed.')</script>");
}
function sendingmail($subject,$message,$reciever,$header){
// Sending Mail
include('smtp/PHPMailerAutoload.php');
$mail=new PHPMailer(true);
$mail->isSMTP();
$mail->Host="smtp.gmail.com";
$mail->Port=587;
$mail->SMTPSecure="tls";
$mail->SMTPAuth=true;
$mail->Username="[email protected]";
$mail->Password="nwmbzqalhsduyfpq";
$mail->SetFrom("[email protected]");
$mail->addAddress("$reciever");
$mail->IsHTML(true);
$mail->Subject=$subject;
$mail->Body=$message;
$mail->SMTPOptions=array('ssl'=>array(
'verify_peer'=>false,
'verify_peer_name'=>false,
'allow_self_signed'=>false
));
if($mail->send()){
$header;
}else{
echo "Mail not sent";
}
}
?>