theMail.setCharset(getCmsObject().getRequestContext().getEncoding()); if (CmsStringUtil.isNotEmpty(getFormConfiguration().getMailFrom())) { theMail.setFrom(getFormConfiguration().getMailFrom());
/** * 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); } }
replyTo = sender; theMail.setFrom(sender); theMail.addReplyTo(replyTo); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getCopy())) {
contactMail = sender; theMail.setFrom(sender); theMail.addReplyTo(contactMail); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getCopy())) {
theMail.setCharset(getCmsObject().getRequestContext().getEncoding()); if (CmsStringUtil.isNotEmpty(getFormConfiguration().getMailFrom())) { theMail.setFrom(getFormConfiguration().getMailFrom());