String fromAddress = handleFromAddress(contactEmailBean.getFromAddress(), locale);
String fromName = handleFromAddress(contactEmailBean.getFromAddress(), locale);
String toEmail = contactEmailBean.getToEmail();
MimeMessagePreparatorImpl mimeMessagePreparator = getMimeMessagePreparator(requestData, Email.EMAIl_TYPE_CONTACT, model);
mimeMessagePreparator.setTo(toEmail);
mimeMessagePreparator.setFrom(fromAddress);
mimeMessagePreparator.setFromName(fromName);
mimeMessagePreparator.setReplyTo(fromAddress);
Object[] parameters = {contactEmailBean.getLastname(), contactEmailBean.getFirstname()};
mimeMessagePreparator.setSubject(coreMessageSource.getMessage("email.contact.email_subject", parameters, locale));
mimeMessagePreparator.setHtmlContent(VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, velocityPath + "contact-html-content.vm", model));
mimeMessagePreparator.setPlainTextContent(VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, velocityPath + "contact-text-content.vm", model));
mimeMessagePreparator.getHtmlContent();
Email email = new Email();
email.setType(Email.EMAIl_TYPE_CONTACT);
email.setStatus(Email.EMAIl_STATUS_PENDING);
saveOrUpdateEmail(email, mimeMessagePreparator);