-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
36 lines (32 loc) · 999 Bytes
/
contact.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
<?php
$conn = mysqli_connect('localhost', 'root', '', 'faida_estate');
session_start();
$email=$_POST['email'];
require 'phpmailer/PHPMailerAutoload.php';
$mail= new PHPMailer;
//$mail->isSTMP(true);
$mail->Host='stmp.gmail.com';
$mail->Port=587;
$mail->STMPAUTH=true;
$mail->STMPSECURE='tls';
$mail->Username='noreplyfaidaestate@gmail.com';
$mail->Password='Faida667';
$mail->setFrom('noreplyfaidaestate@gmail.com','Faida Estate');
$mail->addAddress($email);
$mail->addReplyTo('noreplyfaidaestate@gmail.com');
$mail->isHTML(true);
$mail->Subject=$_POST['subject'];
$mail->Body=$_POST['message'];
if($mail->send()){
echo '<script language="javascript">';
echo 'alert("Mail Sent");';
echo "location.href='../php/admin_manage_users.php;";
echo '</script>';
}
else{
echo '<script language="javascript">';
echo 'alert("Email not Sent...Please Retry");';
echo "location.href='../php/admin_manage_users.php;";
echo '</script>';
}
?>