1

I am trying to instantiate MimeMessage class using Liferay WebContent Velocity template and having difficulty with it. Here is my code

    #set ($properties = $portal.getClass().forName("java.util.Properties").newInstance())

#set ($VOID = $properties.put("mail.smtp.host","10.175.150.156"))
#set ($VOID = $properties.put("mail.smtp.host","25"))

#set ($mailSession = $portal.getClass().forName("javax.mail.Session").getInstance($properties, null))

Mail Session: $mailSession <br/>

#set ($mimeMessage = $portal.getClass().forName("javax.mail.internet.MimeMessage").newInstance($mailSession))

MimeMessage : $mimeMessage <br/>

Here $mimeMessage is not getting instantiated. Could you please let me know what could be wrong?

Sri
  • 309
  • 1
  • 9
  • 24
  • Which version of Velocity are you using? What is your configuration? Especially, do you have any setting for the runtime.introspector.uberspect configuration key? What are the outputs of intermediary calls like $portal.getClass() or $portal.getClass().forName("javax.mail.internet.MimeMessage") ? – Claude Brisson Apr 16 '14 at 08:01

0 Answers0