Guest User

Untitled

a guest
Mar 7th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $phone = $_POST['user_phone'];
  4.  
  5. require_once('phpmailer/PHPMailerAutoload.php');
  6. $mail = new PHPMailer;
  7. $mail->CharSet = 'utf-8';
  8.  
  9. //$mail->SMTPDebug = 3;                               // Enable verbose debug output
  10.  
  11. $mail->isSMTP();                                      // Set mailer to use SMTP
  12. $mail->Host = 'smtp.mail.ru';  // Specify main and backup SMTP servers
  13. $mail->SMTPAuth = true;                               // Enable SMTP authentication
  14. $mail->Username = 'v.nagornyx@mail.ru';                 // Наш логин
  15. $mail->Password = 'artemislamov';                           // Наш пароль от ящика
  16. $mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
  17. $mail->Port = 465;                                    // TCP port to connect to
  18.  
  19. $mail->setFrom('v.nagornyx@mail.ru', 'Василий Нагорных');   // От кого письмо
  20. $mail->addAddress('etitov85@gmail.com');     // Add a recipient
  21. //$mail->addAddress('ellen@example.com');               // Name is optional
  22. //$mail->addReplyTo('info@example.com', 'Information');
  23. //$mail->addCC('cc@example.com');
  24. //$mail->addBCC('bcc@example.com');
  25. //$mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
  26. //$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
  27. $mail->isHTML(true);                                  // Set email format to HTML
  28.  
  29. $mail->Subject = 'Заказ на картон';
  30. $mail->Body    = '
  31.     Пользователь оставил свои данные <br>
  32.     Имя: Секрет <br>
  33.     Телефон: ' . $phone . '';
  34. $mail->AltBody = 'Это альтернативный текст';
  35.  
  36. if(!$mail->send()) {
  37.     echo "Error";
  38. } else {
  39.     echo "Success";
  40. }
  41.  
  42. ?>
Add Comment
Please, Sign In to add comment