Guest User

Untitled

a guest
Apr 17th, 2018
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. <?php
  2. $whatever = $_POST['whatever'];
  3. $username = $_POST['username'];
  4. $email = $_POST['email'];
  5. $password = $_POST['password'];
  6.  
  7. require_once('phpmailer/PHPMailerAutoload.php');
  8. $mail = new PHPMailer;
  9. $mail->CharSet = 'utf-8';
  10.  
  11. //$mail->SMTPDebug = 3; // Enable verbose debug output
  12.  
  13. $mail->isSMTP(); // Set mailer to use SMTP
  14. $mail->Host = 'smtp.mail.ru'; // Specify main and backup SMTP servers
  15. $mail->SMTPAuth = true; // Enable SMTP authentication
  16. $mail->Username = 'mail_smpt@mail.ru'; // SMTP username
  17. $mail->Password = 'pass'; // SMTP password
  18. $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
  19. $mail->Port = 465; // TCP port to connect to
  20.  
  21. $mail->setFrom('mail_smpt@mail.ru', 'Пользователь с сайта');
  22. $mail->addAddress('your-mail@gmail.com', 'Joe User'); // Add a recipient
  23. //$mail->addAddress('ellen@example.com'); // Name is optional
  24. //$mail->addReplyTo('info@example.com', 'Information');
  25. //$mail->addCC('cc@example.com');
  26. //$mail->addBCC('bcc@example.com');
  27. //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
  28. //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
  29. $mail->isHTML(true); // Set email format to HTML
  30.  
  31. $mail->Subject = 'Это тема сообщения';
  32. $mail->Body = 'Это тело сообщения дальше жирное <b>блаблабла</b>';
  33. $mail->AltBody = 'Это сообщение в формате plain text';
  34.  
  35. if(!$mail->send()) {
  36. echo 'Message could not be sent.';
  37. echo 'Mailer Error: ' . $mail->ErrorInfo;
  38. } else {
  39. header('location: thanks.html');
  40. }
  41.  
  42. ?>
Add Comment
Please, Sign In to add comment