
<?php
// Файлы phpmailer
require 'phpmailer/class.phpmailer.php';
require 'phpmailer/class.smtp.php';
$mail = new PHPMailer; // Johnny
$mail->CharSet = 'utf-8'; // Johnny

$name  = trim($_POST["name"]);
$email = trim($_POST["email"]);
$country  = trim($_POST["country"]);
$interests = trim($_POST["interests"]);
$qualifications = trim($_POST["qualifications"]);

// Настройки
$mail->isSMTP(); 
$mail->Host = 'ssl://smtp.yandex.ru:465'; // Johnny
$mail->SMTPAuth = true;                      
$mail->Username = 'pay.soft'; // Ваш логин в Яндексе. Именно логин, без @yandex.ru
$mail->Password = 'Drakedog1488'; // Ваш пароль
$mail->SMTPSecure = 'ssl';                            
$mail->Port = 465;
$mail->setFrom('pay.soft@yandex.by'); // Ваш Email
$mail->addAddress('dezzinlol2@gmail.com'); // Email получателя
//$mail->addAddress('example@gmail.com');  Еще один email, если нужно.

// Прикрепление файлов

 for ($ct = 0; $ct < count($_FILES['file']['tmp_name']); $ct++) {
       $uploadfile = tempnam(sys_get_temp_dir(), sha1($_FILES['file']['name'][$ct]));
       $filename = $_FILES['file']['name'][$ct];
       if (move_uploaded_file($_FILES['file']['tmp_name'][$ct], $uploadfile)) {
           $mail->addAttachment($uploadfile, $filename);
       } else {
           $msg .= 'Failed to move file to ' . $uploadfile;
       }
   }   
                                 
// Письмо
$mail->isHTML(true);
$mail->Subject = 'Paysoft'; // Заголовок письма
$mail->Body = '' . 'Name: ' .$name. '<br/>Email: ' .$email. '<br/>Country: ' .$country. '<br/>Interests: ' .$interests. '<br/>Qualifications: ' .$qualifications ; // Johnny
$mail->send(); // Johnny
?> <!--// Johnny-->
