Advertisement
Guest User

Untitled

a guest
Mar 19th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.21 KB | None | 0 0
  1. <?php
  2. require 'mailer/PHPMailerAutoload.php';
  3.  
  4. $mail = new PHPMailer;
  5.  
  6. $mail->SMTPDebug = 3;                               // Enable verbose debug output
  7.  
  8. $mail->isSMTP();                                      // Set mailer to use SMTP
  9. $mail->Host = 'smtp.yandex.ru';  // Specify main and backup SMTP servers
  10. $mail->SMTPAuth = true;                               // Enable SMTP authentication
  11. $mail->Username = 'no-reply@***.com';                 // SMTP username
  12. $mail->Password = '***';                           // SMTP password
  13. $mail->Port = 465;                                    // TCP port to connect to
  14.  
  15. $mail->setFrom('no-reply@***.com', 'Test');
  16. $mail->addAddress('maks.best5@mail.ru');               // Name is optional
  17. $mail->addReplyTo('maks.best5@mail.ru', 'Information');
  18. $mail->isHTML(true);                                  // Set email format to HTML
  19.  
  20. $mail->Subject = 'Here is the subject';
  21. $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
  22. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  23.  
  24. if(!$mail->send()) {
  25.     echo 'Message could not be sent.';
  26.     echo 'Mailer Error: ' . $mail->ErrorInfo;
  27. } else {
  28.     echo 'Message has been sent';
  29. }
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement