Advertisement
Guest User

Untitled

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