var pengaturanemailpesan=(function(){
	var mode=0;
	return{
		simpan:function(){
			var email=$("#email").val();
			var host=$("#host").val();
			var port=$("#port").val();
			var password=$("#password").val();
			
			var err="";
			if(email=="") err+="Email Akun belum diisi.</br>";
			if(host=="") err+="Host / alamat Akun belum diisi.</br>";
			if(port=="") err+="Port server email.</br>";
			if(password=="") err+="Password Akun email belum diisi.</br>";
			
			if(err!=""){
				var ps={"title":"Peringatan","pesan":err};
				boxpesan.peringatan(ps);
				return;
			}
			
			mload.sh("loader_pengaturan");
			var ik_data = {
				ajax: 1,
				mode: "mod",
				cl: "pengaturanemailpesan",
				ikdata: {0:"simpanpengaturan",email:email,
					host:host,port:port,
					password:password}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",
				type: "POST",
				dataType: "json",
				async:true,
				data: ik_data,
				success: function(e){
					
					mload.hd();
					if(e==1){
						alert("Simpan Pengaturan Berhasil");
					}else{
						alert("Terjadi kesalahan.");
					}
				}
			});
		},
		
	};
})();