Файл: version 2.0.5/demo-order-process.php
Строк: 101
<?php
if( isset($_POST['name']) )
{
$to = 'vokyvon@gmail.com'; // Replace with your email
$subject = 'Order from website'; // Replace with your subject if you need
$message = 'Name: ' . $_POST['name'] . "n" .
'Company: ' . $_POST['company']. "n" .
'E-mail: ' . $_POST['email']. "n" .
'Phone: ' . $_POST['phone']. "nn" .
'Interested in: ' . $_POST['interested']. "n" .
'Budget: ' . $_POST['budget']. "n" .
'Expected start date: ' . $_POST['start']. "n" .
'Expected finish date: ' . $_POST['finish']. "n" .
'About project: ' . $_POST['comment']. "nnn";
// Get a random 32 bit number.
$num = md5(time());
// Define the main headers.
$headers = 'From:' . $_POST['name'] . "rn";
$headers .= 'Reply-To:' . $_POST['email'] . "rn";
$headers .= "MIME-Version: 1.0rn";
$headers .= "Content-Type: multipart/mixed; ";
$headers .= "boundary=$numrn";
$headers .= "--$numrn";
// Define the message section
$headers .= "Content-Type: text/plainrn";
$headers .= "Content-Transfer-Encoding:8bitrnn";
$headers .= "$messagern";
$headers .= "--$numrn";
if( isset($_FILES['file']['tmp_name']) )
{
// Read the file into a variable
$file = fopen($_FILES['file']['tmp_name'], 'r');
$size = $_FILES['file']['size'];
$content = fread($file, $size);
$encoded_content = chunk_split(base64_encode($content));
// Define the attachment section
$headers .= "Content-Type: ". $_FILES['file']['type'] ."; ";
$headers .= 'name="' . $_FILES['file']['name'] . '"' . "rn";
$headers .= "Content-Transfer-Encoding: base64rn";
$headers .= "Content-Disposition: attachment; ";
$headers .= 'filename="' . $_FILES['file']['name'] . '"' . "rnn";
$headers .= "$encoded_contentrn";
$headers .= "--$num--";
}
// Send email
mail ($to, $subject, '', $headers);
}
?>