UOJMail.php 729 B

1234567891011121314151617181920
  1. <?php
  2. require $_SERVER['DOCUMENT_ROOT'].'/app/vendor/phpmailer/PHPMailerAutoload.php';
  3. class UOJMail {
  4. public static function noreply() {
  5. $mailer = new PHPMailer();
  6. $mailer->isSMTP();
  7. $mailer->Host = UOJConfig::$data['mail']['noreply']['host'];
  8. $mailer->Port = UOJConfig::$data['mail']['noreply']['port'];
  9. $mailer->SMTPAuth = true;
  10. $mailer->SMTPSecure = UOJConfig::$data['mail']['noreply']['secure'];
  11. $mailer->Username = UOJConfig::$data['mail']['noreply']['username'];
  12. $mailer->Password = UOJConfig::$data['mail']['noreply']['password'];
  13. $mailer->setFrom(UOJConfig::$data['mail']['noreply']['username'], "UOJ noreply");
  14. $mailer->CharSet = "utf-8";
  15. $mailer->Encoding = "base64";
  16. return $mailer;
  17. }
  18. }