/** * @see java.lang.Object#toString() */ @Override public String toString() { StringBuffer buf = new StringBuffer(64); buf.append(this.getClass().getName()); buf.append(" hostname="); buf.append(getHostname()); buf.append(" port="); buf.append(getPort()); buf.append(" order="); buf.append(m_order); buf.append(" protocol="); buf.append(getProtocol()); if (isAuthenticating()) { buf.append(" user="); buf.append(getUsername()); buf.append(" password="); buf.append(getPassword()); } return buf.toString(); } }
/** * @see java.lang.Object#toString() */ @Override public String toString() { StringBuffer buf = new StringBuffer(64); buf.append(this.getClass().getName()); buf.append(" hostname="); buf.append(getHostname()); buf.append(" port="); buf.append(getPort()); buf.append(" order="); buf.append(m_order); buf.append(" protocol="); buf.append(getProtocol()); buf.append(" security=" + getSecurity()); if (isAuthenticating()) { buf.append(" user="); buf.append(getUsername()); buf.append(" password="); buf.append(getPassword()); } return buf.toString(); } }
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(userName)) { mail.setAuthentication(userName, host.getPassword());
/** * Default constructor of a CmsSimpleMail.<p> * * The mail host name and the mail from address are set to the OpenCms * default values of the configuration.<p> * */ public CmsSimpleMail() { // call super constructor super(); // set the host to the default mail host CmsMailHost host = OpenCms.getSystemInfo().getMailSettings().getDefaultMailHost(); setHostName(host.getHostname()); this.setSmtpPort(host.getPort()); // check if username and password are provided String userName = host.getUsername(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(userName)) { // authentication needed, set user name and password setAuthentication(userName, host.getPassword()); } try { // set default mail from address setFrom(OpenCms.getSystemInfo().getMailSettings().getMailFromDefault()); } catch (EmailException e) { // default email address is not valid, log error LOG.error(Messages.get().getBundle().key(Messages.LOG_INVALID_SENDER_ADDRESS_0), e); } }
/** * Default constructor of a CmsHtmlMail.<p> * * The mail host name and the mail from address are set to the OpenCms * default values of the configuration.<p> * */ public CmsHtmlMail() { // call super constructor super(); // set the host to the default mail host CmsMailHost host = OpenCms.getSystemInfo().getMailSettings().getDefaultMailHost(); setHostName(host.getHostname()); this.setSmtpPort(host.getPort()); // check if username and password are provided String userName = host.getUsername(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(userName)) { // authentication needed, set user name and password setAuthentication(userName, host.getPassword()); } try { // set default mail from address setFrom(OpenCms.getSystemInfo().getMailSettings().getMailFromDefault()); } catch (EmailException e) { // default email address is not valid, log error LOG.error(Messages.get().getBundle().key(Messages.LOG_INVALID_SENDER_ADDRESS_0), e); } }
/** * Default constructor of a CmsHtmlMail.<p> * * The mail host name and the mail from address are set to the OpenCms * default values of the configuration.<p> * */ public CmsMultiPartMail() { // call super constructor super(); // set the host to the default mail host CmsMailHost host = OpenCms.getSystemInfo().getMailSettings().getDefaultMailHost(); setHostName(host.getHostname()); setSmtpPort(host.getPort()); // check if username and password are provided String userName = host.getUsername(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(userName)) { // authentication needed, set user name and password setAuthentication(userName, host.getPassword()); } try { // set default mail from address setFrom(OpenCms.getSystemInfo().getMailSettings().getMailFromDefault()); } catch (EmailException e) { // default email address is not valid, log error LOG.error(Messages.get().getBundle().key(Messages.LOG_INVALID_SENDER_ADDRESS_0), e); } }
host.getProtocol()); if (host.isAuthenticating()) { hostElement.addAttribute(A_USER, host.getUsername()).addAttribute(A_PASSWORD, host.getPassword());
host.getSecurity()); if (host.isAuthenticating()) { hostElement.addAttribute(A_USER, host.getUsername()).addAttribute(A_PASSWORD, host.getPassword());