Advertisement
Guest User

Untitled

a guest
Feb 11th, 2019
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. require 'phpmailer/class.phpmailer.php';
  2. require 'phpmailer/class.smtp.php';
  3.  
  4. $mail_info = mssql_query("SELECT TOP 1 mail FROM mail where used = 0");
  5. $mail_info = mssql_fetch_assoc($mail_info);
  6. $mail_info = $mail_info['mail'];
  7. $mail_info = "igors@webmaking.lv";
  8.  
  9.  
  10.  
  11. $subject = "EasyMu.biz Medium x1000 - 15 February";
  12.  
  13. $mail = new PHPMailer;
  14. $mail->IsSMTP(); // Set mailer to use SMTP
  15. $mail->SMTPDebug = 2;
  16. $mail->Host = 'smtp.gmail.com'; // Specify main and backup server
  17. $mail->Port = 587; // Set the SMTP port
  18. $mail->SMTPAuth = true; // Enable SMTP authentication
  19. $mail->Username = 'easymu.biz@gmail.com'; // SMTP username
  20. $mail->Password = 'roteiro2'; // SMTP password
  21. $mail->SMTPSecure = 'tls';
  22. $mail->CharSet = 'UTF-8';
  23. $mail->From = 'easymu.biz@gmail.com';
  24. $mail->FromName = 'EasyMu.biz';
  25. //$mail->AddAddress('igors@webmaking.lv', 'Igors WebMaking.Lv'); // Add a recipient
  26. $mail->AddAddress($mail_info); // Name is optional
  27.  
  28. $mail->IsHTML(true); // Set email format to HTML
  29.  
  30. $mail->Subject = $subject;
  31. $mail->Body = "";
  32. //$mail->AltBody = $_POST['textarea'];
  33.  
  34. if(!$mail->Send()) {
  35. // echo 'Message could not be sent.';
  36. // echo 'Mailer Error: ' . $mail->ErrorInfo;
  37. // exit;
  38. // $this->flashMessageContainer->add('');
  39. echo "Mail send. :)";
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement