-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /var/www/html/inc.bk/class/
File Upload :
Current File : /var/www/html/inc.bk/class/function.send.php

<?php

###########################################
// send
###########################################

	function encode_2047 ( $string )
	{
		return '=?euc-kr?b?' . base64_encode($string) . '?=' ;
	}

	function send_smpt ( $from , $to , $subject , $content ) {
		//include $_SERVER['DOCUMENT_ROOT'] . '/inc/class/class.smtp.php' ;
		//$mail = new Smtp;
		//#$mail->debug();
		//$mail->sendmail($to, $from, $subject, $content);
		$subject = encode_2047($subject);
		$headers  = "MIME-Version: 1.0\r\n";
		$headers .= "Content-type: text/html; charset=euc-kr\r\n";
		$headers .= "From: $from\r\n";
		$headers .= "Content-Transfer-Encoding: 7bit\r\n";
		mail($to, $subject, $content, $headers) ;
	}

	function send_mail ( $from , $to , $subject , $content , $save_path = '' , $delete_type = 'N' )
	{
		$content = stripslashes($content) ;
		$subject = stripslashes($subject) ;

		if ( !empty($save_path))
		{
			$dir = create_dir ( $save_path ) ;
			$tmp_file_name = date('YmdHis') . '.html' ;
			$fp = @fopen($dir . '/' . $tmp_file_name , 'a+' ) ;
			@fputs($fp , "<!-- BEGIN OF TITLE -->\n" . $subject . "\n<!-- END OF TITLE -->\n<!-- BEGIN OF MAIL -->\n" . $content . "\n<!-- END OF MAIL -->" ) ;
			fclose($fp) ;
			$content = file_separate('MAIL', '/' . $save_path . '/' . $tmp_file_name);
			if ( $delete_type == 'Y' ) {
				file_delete($save_path . '/' . $tmp_file_name) ;
			}
		}
	#	$subject = encode_2047($subject);
	#	$headers  = "MIME-Version: 1.0\r\n";
	#	$headers .= "Content-type: text/html; charset=euc-kr\r\n";
	#	$headers .= "From: $from\r\n";
	#	$headers .= "Content-Transfer-Encoding: 7bit\r\n";
		$tos = explode(',', $to);
	#	$COUNT = array ('fail'=>0,'success'=>0);

		include $_SERVER['DOCUMENT_ROOT'] . '/inc/class/class.smtp.php' ;
		$mail = new Smtp;
		$mail->connect();
		$i = 0 ;
		foreach ($tos as $key=>$val)
		{
			$i++ ;
			if ( $i%100 === 0 ) sleep(10) ;
			$mail->send($val, $from, $subject, $content) ;

		#	mail($val, $subject, $content, $headers) ;
		#	if (mail($val, $subject, $content, $headers))
		#		$COUNT[success]++;
		#	else
		#		$COUNT[fail]++;
		}
		$mail->close();
		#return $COUNT;
	}

	function send_sms($from, $to, $msg, $tran_id = '' )
	{
		if (empty($tran_id)) $tran_id = $_SERVER['SERVER_NAME'];
		global $exe , $info_sms ;
		if ( $info_sms['quotation_send'] == 'N' ) return ;
		$sms_table = 'em_tran';
		$datetime = date(Ym);
		$tbl_sms = 'em_log_' . $datetime;
		$tran_back = $from;
		$tran_date = date('Y-m-d H:i:s');
		$query = " INSERT INTO winple_sms.{$sms_table} ( " .
					   " tran_pr, tran_id, tran_callback, " .
					   " tran_status, tran_date, tran_msg, " .
					   " tran_phone ) VALUES ( " .
					   " '' , '$tran_id' , '$tran_back' , " .
					   " 1 , '$tran_date' , '$msg' , " .
					   "'$to' ) ";
		mysql_query($query);
		return true;
	}
?>

Copyright © 2017 || Recoded By Mr.Bumblebee