-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend.php
53 lines (33 loc) · 1011 Bytes
/
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
48
49
50
51
52
53
<?php
$name= $_POST['nom'];
$surname= $_POST['prenom'];
$message= $_POST['message'];
$email= $_POST['email'];
$subject= $_POST['subject'];
require_once 'images/config_projet.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'phpmailer/src/Exception.php';
require 'phpmailer/src/phpmailer.php';
require 'phpmailer/src/SMTP.php';
if(isset($_POST["send"])) {
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host='smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username= _APP_EMAIL_;
$mail->Password= 'jvdesbqhbplcizjl';
$mail->SMTPSecure='ssl';
$mail->Port= 465;
$mail->setFrom(_APP_EMAIL_, $name, $surname);
$mail->addAddress($_POST['email']);
$mail->isHTML(true);
$mail->Subject= $subject;
$mail->Body= $message;
$mail->send();
}
echo " <script>
alert('message envoyé');
document.location.href='ecfgarage.php';
</script>"
?>