-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvirtualization-order.php
117 lines (77 loc) · 3.08 KB
/
virtualization-order.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
$vizitkaData = json_decode($_POST['arr1']);
//Telo pis'ma ==> start
$body = "<!doctype html><html><head></head><body>";
$body .= "<a href='http://ice-tc.com'>ice-tc.com</a></br>";
$body .= "<h1>Получен заказ на услугу Виртуализации</h1></br>";
foreach ($vizitkaData as $key => $value) {
if($key=='undefined'){
$body .= "</br><h2>Контакты: </h2>";
foreach ($value as $k => $v) {
$body .= "<p> $k : $v </p>";
}
}else if($key=='Пропускная способность'){
$body .= "</br><h2>Пропускная способность: </h2>";
foreach ($value as $k => $v) {
$body .= "<p> Объем : $v Гбайт.</p>";
}
}else{
$body .= "</br><h2>$key</h2>";
foreach ($value as $k => $v) {
$body .= "<p> $k : $v </p>";
}
}
}
$body .= "</body></html>";
//date_default_timezone_set('Etc/UTC');
require 'lib/PHPMailerAutoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer();
//Charset
$mail->CharSet = 'UTF-8';
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 0;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = "icetccom.ipage.com";
//Set the encryption system to use - ssl (deprecated) or tls
//$mail->SMTPSecure = 'ssl';
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = "[email protected]";
//Password to use for SMTP authentication
$mail->Password = "Nazarbayev8";
//Set who the message is to be sent from
$mail->setFrom('[email protected]', '[email protected]');
//Set an alternative reply-to address
$mail->addReplyTo('[email protected]', '[email protected]');
//Set the subject line
$mail->Subject = 'Получен заказ на Виртуализацию';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->Body = $body;
$mail->IsHTML(true); /* <== call IsHTML() after $mail->Body has been set. */
//Replace the plain text body with one created manually
$mail->AltBody = 'Из за проблем отправки HTML письма отправляется этот текст';
//Attach an image file
//$mail->addAttachment('images/phpmailer_mini.png');
//send to name
$mail->FromName = "Форма заказа сайтов с сайта ice-tc.com";
//Sen to this e-mail
$mail->AddAddress("[email protected]");
//send the message, check for errors
if (!$mail->send()) {
echo "Ошибка отправки: " . $mail->ErrorInfo;
}else{
echo "Ваша заявка принята! Мы Вам позвоним в ближайшее время";
}
?>