public int getSMTPPort() { return getCurrentConfiguration( false ).getPort(); }
public ValidationResponse validateSmtpConfiguration( ApplicationValidationContext ctx, CSmtpConfiguration settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } if ( StringUtils.isEmpty( settings.getHostname() ) ) { ValidationMessage msg = new ValidationMessage( "host", "SMTP Host is empty." ); response.addValidationError( msg ); } if ( settings.getPort() < 0 ) { ValidationMessage msg = new ValidationMessage( "port", "SMTP Port is inavlid. Enter a port greater than 0." ); response.addValidationError( msg ); } if ( StringUtils.isEmpty( settings.getSystemEmailAddress() ) ) { ValidationMessage msg = new ValidationMessage( "systemEmailAddress", "System Email Address is empty." ); response.addValidationError( msg ); } return response; }
config.setDebug( smtp.isDebugMode() ); config.setMailHost( smtp.getHostname() ); config.setMailPort( smtp.getPort() ); config.setPassword( smtp.getPassword() ); config.setSsl( smtp.isSslEnabled() );
public static SmtpSettings convert(CSmtpConfiguration settings) { if (settings == null) { return null; } SmtpSettings result = new SmtpSettings(); result.setHost(settings.getHostname()); result.setPassword(PASSWORD_PLACE_HOLDER); result.setPort(settings.getPort()); result.setSslEnabled(settings.isSslEnabled()); result.setSystemEmailAddress(settings.getSystemEmailAddress()); result.setTlsEnabled(settings.isTlsEnabled()); result.setUsername(settings.getUsername()); return result; }
public static SmtpSettings convert( CSmtpConfiguration settings ) { if ( settings == null ) { return null; } SmtpSettings result = new SmtpSettings(); result.setHost( settings.getHostname() ); result.setPassword( PASSWORD_PLACE_HOLDER ); result.setPort( settings.getPort() ); result.setSslEnabled( settings.isSslEnabled() ); result.setSystemEmailAddress( settings.getSystemEmailAddress() ); result.setTlsEnabled( settings.isTlsEnabled() ); result.setUsername( settings.getUsername() ); return result; }