public MailConfiguration() { setPort(25); setHost("localhost"); }
public MailConfiguration() { this.mailSenderConfiguration = Utils.getComponent(MailSenderConfiguration.class); setPort(25); setHost("localhost"); }
public MailConfiguration(XWiki xwiki) { this(); String smtpServer = this.mailSenderConfiguration.getHost(); if (!StringUtils.isBlank(smtpServer)) { setHost(smtpServer); } int port = this.mailSenderConfiguration.getPort(); setPort(port); String from = this.mailSenderConfiguration.getFromAddress(); if (!StringUtils.isBlank(from)) { setFrom(from); } String smtpServerUsername = this.mailSenderConfiguration.getUsername(); String smtpServerPassword = this.mailSenderConfiguration.getPassword(); if (!StringUtils.isEmpty(smtpServerUsername) && !StringUtils.isEmpty(smtpServerPassword)) { setSmtpUsername(smtpServerUsername); setSmtpPassword(smtpServerPassword); } Properties javaMailExtraProps = this.mailSenderConfiguration.getAdditionalProperties(); if (!javaMailExtraProps.isEmpty()) { setExtraProperties(javaMailExtraProps); } }
public MailConfiguration(XWiki xwiki) { this(); String smtpServer = xwiki.getXWikiPreference("smtp_server"); if (!StringUtils.isBlank(smtpServer)) { setHost(smtpServer); } int port = xwiki.getXWikiPreferenceAsInt("smtp_port", 25); setPort(port); String from = xwiki.getXWikiPreference("smtp_from"); if (!StringUtils.isBlank(from)) { setFrom(from); } String smtpServerUsername = xwiki.getXWikiPreference("smtp_server_username"); String smtpServerPassword = xwiki.getXWikiPreference("smtp_server_password"); if (!StringUtils.isEmpty(smtpServerUsername) && !StringUtils.isEmpty(smtpServerPassword)) { setSmtpUsername(smtpServerUsername); setSmtpPassword(smtpServerPassword); } String javaMailExtraProps = xwiki.getXWikiPreference("javamail_extra_props"); if (!StringUtils.isEmpty(javaMailExtraProps)) { setExtraProperties(javaMailExtraProps); } }