Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //header ('Content-type: text/html; charset=utf-8');
- $SendMail = "efmircdma@gmail.com";
- class LastronMailer {
- public function replice($string){
- $string = preg_replace("/</si","<",$string);
- $string = preg_replace("/>/",">",$string);
- $string = trim($string);
- return($string);
- }
- public function LoadData($string){
- // ------- определяем массив для месяцев ----------
- $q = array(); // обнуляем массив
- $q[]= "";
- $q[]= "января"; $q[]= "февраля"; $q[]= "марта";
- $q[]= "апреля"; $q[]= "мая"; $q[]= "июня";
- $q[]= "июля"; $q[]= "августа"; $q[]= "сентября";
- $q[]= "октября"; $q[]= "ноября"; $q[]= "декабря";
- // ------- определяем массив для дней недели ----------
- $e = array();
- $e[]="воскресенье"; $e[]="понедельник";
- $e[]="вторник"; $e[]="среда";
- $e[]="четверг"; $e[]="пятница";
- $e[]="суббота";
- $m = date('m'); // ---- считываем месяц
- $m = intval($m);
- $den = date('w'); // ---- считываем день недели
- $chislo = date('d'); // ---- считываем число
- $den_nedeli = @$e[$we]; // ---- извлекаем из массива соответствующее значение дня недели
- $mesyac = $q[$m]; // ---- извлекаем из массива соответствующее значение месяца
- $god = date('Y');
- if ($string == 1){
- $data_time = $den_nedeli . " " . $chislo . " " . $mesyac;
- return $data_time;
- }
- }
- private function SendMail($to, $subject, $text, $from, $file, $type){
- $uid = strtoupper(md5(uniqid(time())));
- $header = "From: ".$from."\nReply-To: ".$from."\n";
- $header .= "LASTRON-MAIL: v1.0\n";
- $header .= "Content-Type: multipart/mixed; boundary=".$uid."\n";
- $header .= "--".$uid."\n";
- $header .= "Content-type: text/html; charset=". $type . "\r\n";
- $header .= "Content-Transfer-Encoding: 8bit\n\n";
- $header .= $text."\n";
- $header .= "--".$uid."--";
- if(@mail($to, $subject, "", $header)){ return true;}
- else {return false;}
- }
- public function Send($Name){
- if($this->SendMail($Name['1'], $Name['2'], $Name['7'], $Name['4'], $Name['5'], $Name['6'])){
- return true;
- }
- else{
- return false;
- }
- }
- public function isMail ($mail){
- return preg_match("/^([\w\.\-])+@([\w\.\-]+\\.)+[a-z]{2,6}$/i", $mail);
- }
- public function isName ($name){
- return preg_match("/^[A-zА-я]+$/i", $name);
- }
- public function isPhone ($phone){
- return preg_match("/^[0-9\+\s]+$/i", $phone);
- }
- public function isCity ($city){
- return preg_match("/^[A-zА-я]+$/i", $city);
- }
- }
- function htmlForm(){
- global $errName, $errPhone, $errMail, $errCity;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement