private boolean setNewConfiguration()

in service/src/main/java/org/apache/fineract/cn/notification/service/internal/service/EmailService.java [94:112]


	private boolean setNewConfiguration(EmailConfiguration configuration) {
		try {
			this.mailSender.setHost(configuration.getHost());
			this.mailSender.setPort(Integer.parseInt(configuration.getPort()));
			this.mailSender.setUsername(configuration.getUsername());
			this.mailSender.setPassword(configuration.getApp_password());
			
			Properties properties = new Properties();
			properties.put(ServiceConstants.MAIL_TRANSPORT_PROTOCOL_PROPERTY, configuration.getProtocol());
			properties.put(ServiceConstants.MAIL_SMTP_AUTH_PROPERTY, configuration.getSmtp_auth());
			properties.put(ServiceConstants.MAIL_SMTP_STARTTLS_ENABLE_PROPERTY, configuration.getStart_tls());
			this.mailSender.setJavaMailProperties(properties);
			this.isConfigured = true;
			return true;
		} catch (RuntimeException ignore) {
			logger.error("Failed to configure the Email Gateway");
		}
		return false;
	}