theMail.setCharset(getCmsObject().getRequestContext().getEncoding()); if (CmsStringUtil.isNotEmpty(getFormConfiguration().getMailFrom())) { theMail.setFrom(getFormConfiguration().getMailFrom());
/** * Sends the given message to the given addresses.<p> * * @param cms the cms context * * @throws Exception if something goes wrong */ public void sendEmail(CmsObject cms) throws Exception { // create a plain text email CmsSimpleMail theMail = new CmsSimpleMail(); theMail.setCharset(cms.getRequestContext().getEncoding()); theMail.setFrom(cms.getRequestContext().getCurrentUser().getEmail(), getFrom()); theMail.setTo(createInternetAddresses(getTo())); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getCc())) { theMail.setCc(createInternetAddresses(getCc())); } theMail.setSubject("[" + OpenCms.getSystemInfo().getServerName() + "] " + getSubject()); theMail.setMsg(getMsg()); // send the mail theMail.send(); }
theMail.setCharset(getCmsObject().getRequestContext().getEncoding()); if (CmsStringUtil.isNotEmpty(getFormConfiguration().getMailFrom())) { theMail.setFrom(getFormConfiguration().getMailFrom());