-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform-process.php
More file actions
48 lines (43 loc) · 1.69 KB
/
Copy pathform-process.php
File metadata and controls
48 lines (43 loc) · 1.69 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
48
<?php
require_once '/home/e/elixe/cosmetik.elixire-samara/public_html/phpmailer/Exception.php';
require_once '/home/e/elixe/cosmetik.elixire-samara/public_html/phpmailer/PHPMailer.php';
require_once '/home/e/elixe/cosmetik.elixire-samara/public_html/phpmailer/SMTP.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
if (!empty($_POST["phone"]) || !empty($_POST['email'])){
$name = $_POST["name"];
$phone = $_POST["phone"];
$email = $_POST["email"];
$Body = 'Заказ звонка <br/>';
$Body .= 'Имя: ';
$Body .= $name;
$Body .= '<br/>';
$Body .= 'Телефон: ';
$Body .= $phone;
if (!empty($_POST['email'])){
$Body .= 'Заказ учебного плана на почту: ';
$Body .= $email;
}
$mail = new PHPMailer(true);
try {
$mail->SMTPDebug = 0;
$mail->isSMTP();
$mail->Host = 'ssl://smtp.yandex.ru';
$mail->SMTPAuth = true;
$mail->Username = 'teplosnab-sait@yandex.ru';
$mail->Password = 'SjRWLMske7n7wuc';
$mail->SMTPSecure = 'tls';
$mail->Port = 465;
$mail->setFrom('teplosnab-sait@yandex.ru', 'Elixir');
$mail->addAddress('info@sdomed.ru', 'Joe User');
$mail->addAddress('2703060@gmail.com', 'Joe User');
$mail->isHTML(true);
$mail->Subject = 'Заказ звонка Elixir курс';
$mail->Body = str_replace ( "\n" , "" , $Body);
$mail->send();
echo 'success';
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}
}
?>