I am trying to send HTML emails using gmail smtp. The app is hosted in
tomcat6. The code i use is the same as specified in the spring documentation
and looks like this

public void sendHtmlMessage(final SimpleMailMessage mailMessage, final
String templateName, final Map<String, Object> model) throws
MessagingException {
        MimeMessagePreparator preparator = new MimeMessagePreparator() {

            public void prepare(MimeMessage mimeMessage) throws Exception {
                MimeMessageHelper message = new
MimeMessageHelper(mimeMessage);
                message.setTo(mailMessage.getTo());
                message.setFrom(mailMessage.getFrom());
                message.setSubject(mailMessage.getSubject());
                String text = VelocityEngineUtils.mergeTemplateIntoString(
                        velocityEngine, templateName, model);
                message.setText(text, true);
            }
        };

        ((JavaMailSenderImpl) mailSender).send(preparator);
    }

Emails get sent out perfectly when running maven / jetty, but when the app
runs inside TomCat6, a blank email is sent. (No subject/no body)

Did anyone get this issue? Is there a fix for this? I have tried everything
found by searching the net, nothing works!

Thanks in advance,
aakhunaten
-- 
View this message in context: 
http://www.nabble.com/Issue-sending-HTML-emails-tp20068214s2369p20068214.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to