<?php
	require_once("config/connect.php");
	require_once("config/pageConfig.php");
	require_once("global_functions.php");
	check_login('', '', 'ENABLERKEY_ADMIN_KONFIGURATION');
	
	$tOp="";
	
	define ("SMTP_SERVER",		  	"mail.gmx.net");
	define ("SMTP_ABSENDER",	  	"67430193");
	define ("SMTP_ABSENDER_ANZEIGE","k_muster@gmx.at");
	define ("SMTP_ABSENDER_PW",	  	"_setenta_80");
	//define ("SMTP_SECURE",		  	"tls");	
	//define ("SMTP_AUTH",		  	"true");
	define ("SSH_COMMAND",		  	"bin\\plink");
	define ("DATA_FOLDER",			"data\\");
	define ("LOG_FOLDER",			"log\\");
	define ("LOG_DELETE_OLDER_THAN", "30");       // remove log files older than 30 days in log folder
	define ("ERROR_LOG", 			".\\log\\error.log");
	define ("STANDARD_LOG",			".\\log\\zabbix.log");
	// Einstellungen für quota setzen
	define ("STORAGE_SYSTEM_FILE", 	"config\\storage_systeme.csv");
	// Optionen für das kopieren
	define ("ROBOCOPY",				"robocopy");
	define ("COPY_ISILON_FILE", 	"config\\copy_isilon_data.csv");
	// Wenn robocopy noch läuft, dann warte 600 Sekunden um zu sehen, ob sich das log File geändert hat
	// geändert auf 3 Stunden - RFR 01.06.2015
	define ("SLEEP_TIME_IF_RUNNING", "10800");
	
	
	function schicke_mail($empfaenger, $subject, $output)
	{
		require_once("include/phpMailer/PHPMailerAutoload.php");
		global $tOp;
		echo $tOp.="<hr />";
	
		$mail = new PHPMailer;
		$mail->isSMTP();
		$mail->SMTPDebug  = 2;
		$mail->Host = "212.227.17.190";
		$mail->Username = "k_muster@gmx.at";
        $mail->SMTPAuth   = true; 
		$mail->Password = "_setenta_80";
		$mail->Port       = 25;
		$mail->AddAddress("supperclub@gmx.at");
        $mail->Subject = "xxxxxxxxxxx";
        $mail->Body = "trallllllllllllllllllllllaaaaaaaaaaaaaaaa"; 
		
		if(!$mail->Send()) { 
			$tOp.= "Mailer Error: " . $mail->ErrorInfo;             
		}  
		
		
	/*	if (defined('SMTP_ABSENDER')) $mail->Username   = SMTP_ABSENDER;
		if (defined('SMTP_ABSENDER_PW')) $mail->Password   = SMTP_ABSENDER_PW;  
		$mail->Port = 25;
		if (defined('SMTP_SECURE')) $mail->SMTPSecure = SMTP_SECURE;
		if (defined('SMTP_AUTH')) $mail->SMTPAuth = SMTP_AUTH;
		
		$mail->setFrom(SMTP_ABSENDER, SMTP_ABSENDER_ANZEIGE);
		//$mail->SMTPDebug  = 2;
		$empfaenger_array=explode( ";", $empfaenger);
		foreach ($empfaenger_array as $empf)
		{
			$mail->addAddress($empf);
		}
		$mail->Subject = $subject;
		$mail->msgHTML($output);
		
		echo $mail->From;
		
		if (!$mail->send()) 
		{
			//echo "ERROR sending Mail :" . $mail->ErrorInfo;
			# log_fehler("Error sending mail :" . $mail->ErrorInfo, FALSE, FALSE, "error");
			
		} 
	*/
	}
	
	if(isset($_POST['mailX']) && $_POST['mailX'] =='mailX' ){
		schicke_mail('supperclub@gmx.at', 'subj', 'cccccccccccccccccccccc');
		
		
	}
	
	

?>
<head>
<meta charset="utf-8">
<title>Mail Test</title>
	<?php echo META_DATA_ADMIN; ?>

	<link rel="stylesheet" type="text/css" href="include/menue.css">
	<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" >
	<style type="text/css">
	<?php include 'include/main.css'; ?>
	<?php include 'include/menue.css'; ?>
	
	#ui-datepicker-div { left:500px;}
	</style>
	
	<script>
	

		function xxxData(){
			
		
		}
		

		
		function checkMail(){
			alert("ggffgfgfgf");
		
		}
	
	
	
	</script>
	
	
	

</head>

<body>

	
	<hr />

	<button class="button_gross button_none_float organge" onclick="checkMail()" />Test Php Mailer</button>
	
	<form action="test_mail.php" method="post" >
		<input type="hidden" name="mailX" value="mailX" />
		<button type="submit" class="button_gross button_none_float organge"  />Mail Form</button>
	</form>
	
	<hr />
	
	<?php 
		echo $tOp; 
	
	
	
	
	?>














</body>
</html>
