-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtomail.php
More file actions
30 lines (27 loc) · 861 Bytes
/
tomail.php
File metadata and controls
30 lines (27 loc) · 861 Bytes
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
<?php
$name = $_POST['name'];
$tel = $_POST['tel'];
$item = $_POST['item'];
$message_to_myemail = '
<table>
<tbody>
<tr style="background: #F4F4F4;">
<td style="padding: 5px 10px">Имя:</td><td style="padding: 5px 10px">' . $name . '</td>
</tr>
<tr>
<td style="padding: 5px 10px">Телефон:</td><td style="padding: 5px 10px">' . $tel . '</td>
</tr>
<tr style="background: #F4F4F4;">
<td style="padding: 5px 10px">Выбраный товар:</td><td style="padding: 5px 10px">' . $item . '</td>
</tr>
</tbody>
</table>';
$from = "From: <admin@smartwatch.ru> \r\n";
$from .= "Content-type: text/html; charset=utf-8\r\n";
$status = mail('smartmywatch@gmail.com', 'Сообщение с сайта Smart Watch', $message_to_myemail, $from);
if($status){
echo true;
}else{
echo false;
}
?>