forked from shivangisahay14/autoresponseemail
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmail-process.php
More file actions
47 lines (44 loc) · 1.23 KB
/
Copy pathmail-process.php
File metadata and controls
47 lines (44 loc) · 1.23 KB
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
<?php
include_once 'database.php';
$first_name = $_POST['name'];
$last_name = $_POST['email'];
$city_name = $_POST['phone_no'];
$email = $_POST['message'];
/* sql query for inserting data into database */
mysqli_query($conn,"insert into employee (name,email,phone_no,message) values ('$name','$email','$phone_no','$message')") or die(mysqli_error());
require_once 'mailer/class.phpmailer.php';
/* creates object */
$mail = new PHPMailer(true);
$mailid = $email;
$subject = "Thank you";
$text_message = "Hello";
$message = "Thank You for Contact with us.";
try
{
$mail->IsSMTP();
$mail->isHTML(true);
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = '465';
$mail->AddAddress($mailid);
$mail->Username ="fabcutsofficial@gmail.com";
$mail->Password ="password@123";
$mail->SetFrom('fabcutsofficial@gmail.com','Team FabCuts');
$mail->AddReplyTo("fabcutsofficial@gmail.com","Team FabCuts");
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AltBody = $message;
if($mail->Send())
{
echo "Thank you for register u got a notification through the mail you provide";
}
}
catch(phpmailerException $ex)
{
$msg = "
".$ex->errorMessage()."
";
}
?>