protected function isCorrectEmailAddress($email,$title='') {
		if (is_array($email)) {
			$email = $email['address'];
		}
		
		if ($title == '') {
			$title = 'Email';
		}
		
		if (trim($email) == '') {
			throw new \Exception($title.' address can not be empty');
		}
		
		// email can be in breakets
		if (preg_match('!<.+>!',$email,$f)) {
			$email = $f[1];
		}
		
		// check against regular expression
		$regexp = '!^[_a-z0-9-+]+(\\.[_a-z0-9-+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$!i';
		
		if (strpos($email,',') > 0) {
			// can be list of meails
			$emails = explode(',',$email);
			
			foreach ($emails as $email) {
				if (trim($email) == '') {
					return false;
				}
				if (!preg_match($regexp, $email)) {
					throw new \Exception($title.' address has wrong format');
				}
			}
			return true;
		}
		
		if (!preg_match($regexp, $email)) {
			throw new \Exception($title.' address has wrong format');
		}
		return true;
	}