-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact_me2.php
47 lines (37 loc) · 1.29 KB
/
contact_me2.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
<?php
require 'forms/PHPMailerAutoload.php';
if (isset($_POST["submit"]))
{
$name = $_POST["name"];
$phone = $_POST["phone"];
$email = $_POST["email"];
$message = $_POST["message"];
//Create a new PHPMailer instance
$mail = new PHPMailer;
$mail->CharSet = 'UTF-8';
$mail->From = $email;
$mail->FromName = $name;
$mail->addAddress('[email protected]');
$mail->addCC('');
$mail->addReplyTo($email);
$mail->isHTML(true);
$mail->Subject = 'Contact me';
$mail->Body = '';
$mail->Body .= '<p>Dear <strong>: UniQ Soft Technology Administrator</strong> </p>';
$mail->Body .= '<p>Kindly be informed that you have recieved a contact demande you will find the needed info and message below :</p>';
$mail->Body .= '<p>* Name : <strong>'.$name.'</strong> </p>';
$mail->Body .= '<p>* Phone : <strong>'.$phone.'</strong> </p>';
$mail->Body .= '<p>* Email adresse : <strong>'.$email.'</strong> </p>';
$mail->Body .= '<p>* Demand : <strong>'.$message.'</strong> </p>';
$mail->Body .= '<p>Best regards,</p>';
//
if(!$mail->send()) {
echo '<strong style="color: red;" >Message not sent! Try again another time</strong>';
//echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
header('Location: index.html');
exit();
//echo 'Message has been sent';
}
}
?>