Exemplo n.º 1
0
 public function runModule($args)
 {
     $require = array('waitting_for' => NULL);
     $getArgs = $this->initArgs($args, $require);
     if ($getArgs['waitting_for'] && isset($this->stack[$getArgs['waitting_for']]['mailer'])) {
         $phpmailer = new Phpmailer();
         $userModel = $this->loadModel('users');
         $webMaster = $userModel->fetchOneByKey(1);
         $phpmailer->isSMTP();
         $phpmailer->SMTPDebug = __DEBUG__;
         $phpmailer->CharSet = $this->stack['static_var']['charset'];
         $phpmailer->Encoding = 'base64';
         $phpmailer->From = $webMaster['user_mail'];
         $phpmailer->FromName = $webMaster['user_name'];
         $phpmailer->Host = $this->stack['static_var']['smtp_host'];
         $phpmailer->Port = $this->stack['static_var']['smtp_port'];
         $phpmailer->SMTPAuth = $this->stack['static_var']['smtp_auth'];
         $phpmailer->IsHTML(false);
         $phpmailer->IsSSL($this->stack['static_var']['smtp_ssl']);
         $phpmailer->Username = $this->stack['static_var']['smtp_user'];
         $phpmailer->Password = $this->stack['static_var']['smtp_pass'];
         $phpmailer->AddAddress($this->stack[$getArgs['waitting_for']]['mailer']['send_to'], $this->stack[$getArgs['waitting_for']]['mailer']['send_to_user']);
         if (isset($this->stack[$getArgs['waitting_for']]['mailer']['reply']) && $this->stack[$getArgs['waitting_for']]['mailer']['reply']) {
             $phpmailer->AddReplyTo($this->stack[$getArgs['waitting_for']]['mailer']['reply'][1], $this->stack[$getArgs['waitting_for']]['mailer']['reply'][0]);
         }
         $phpmailer->WordWrap = 50;
         $phpmailer->Subject = $this->stack[$getArgs['waitting_for']]['mailer']['subject'];
         $phpmailer->Body = $this->stack[$getArgs['waitting_for']]['mailer']['body'];
         $phpmailer->Send();
     }
 }
Exemplo n.º 2
0
 function sendMail($file_name_sql)
 {
     require_once 'Phpmailer.php';
     $mailObj = new Phpmailer();
     $datetime = date("Y-m-d H:i:s");
     $firstname = "IOSS";
     $email = "*****@*****.**";
     $FILE_NAME = $file_name_sql;
     $mailBodyDetails = "Please find the attachment containing Infinite MLM Software database backup.\n<br/><br/> File name : {$file_name_sql} <br/>\n<br/>To Download File click here https://infinitemlmsoftware.com/soft/binary/db_backup/dump/{$file_name_sql} <br/><br/>\n                           Keep this file safe in order to restore the database if required.\n                           Regards,<br /><b>Team IOSS</b><br />https://www.ioss.in";
     $mailObj->From = $email;
     $mailObj->FromName = $firstname;
     $mailObj->Subject = "CRM Backup - " . $datetime;
     $mailObj->IsHTML(true);
     $mailObj->Body = $mailBodyDetails;
     $mailObj->ClearAddresses();
     $mailObj->AddAddress('*****@*****.**');
     //PASSWORD:cander1055mlm
     //if($FILE_NAME !="")
     //$mailObj->AddAttachment($FILE_NAME);
     if (!$mailObj->send()) {
         echo "Mailer Error: " . $mailObj->ErrorInfo;
     } else {
         echo "Message sent!";
         $cmd = "rm {$FILE_NAME}";
         exec($cmd);
     }
     //echo $FILE_NAME;
 }