-
Notifications
You must be signed in to change notification settings - Fork 0
/
send.php
47 lines (33 loc) · 1.06 KB
/
send.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
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
</head>
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'C:\xampp\sendmail\phpmailer\src\Exception.php';
require 'C:\xampp\sendmail\phpmailer\src\PHPMailer.php';
require 'C:\xampp\sendmail\phpmailer\src\SMTP.php';
if(isset($_POST["send"])){
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'pkmxrssenteylwbc';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->addAddress($_POST["email"]);
$mail->setFrom($_POST["email"], $_POST["name"]);
$mail->addAddress('[email protected]');
$mail->isHTML(true);
$mail->Subject = $_POST["subject"];
$mail->Body = $_POST["message"];
$mail->send();
echo "
<script>
alert('sent successfully')
document.location.href = 'sent.html'
</script>
";
}
?>