Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
chirag @ India
How to send Email using Structure and template ?
25. April 2013 04:30
Antwort

chirag @ India

Rang: Regular Member

Nachrichten: 129

Eintrittsdatum: 20. Dezember 2011

Neue Beiträge

Hi guys

I want to send email using velocity template . i try below code, but not working.

#set($MailService = $serviceLocator.findService('com.liferay.mail.service.MailService'))
#set($MailEngine = $serviceLocator.findService('com.liferay.util.mail.MailEngine'))
#set($MailBus = $serviceLocator.findService('com.liferay.portal.kernel.messaging.MessageBus'))
#set ($to = $portal.getClass().forName("javax.mail.internet.InternetAddress").newInstance("abc@gmail.com"))
#set ($from = $portal.getClass().forName("javax.mail.internet.InternetAddress").newInstance("xyz@gmail.com"))
#set($sub="test")
#set($body="testmsg")
#set ($msg = $portal.getClass().forName("com.liferay.portal.kernel.mail.MailMessage").newInstance())
$msg.setTo($to)
$msg.setFrom($from)
$msg.setSubject($sub)
$msg.setBody($body)
$MailService.sendEmail($msg)
$MailEngine.send($from, $to, $sub, $body)


&&&&Help Me&&&&&
Anonym
RE: How to send Email using Structure and template ?
25. April 2013 09:42
Antwort

Anonym

I'm glad you asked, I hope this helps.

https://gist.github.com/randombrad/3101535
chirag @ India
RE: How to send Email using Structure and template ?
29. April 2013 06:48
Antwort

chirag @ India

Rang: Regular Member

Nachrichten: 129

Eintrittsdatum: 20. Dezember 2011

Neue Beiträge

hi Bradley,

Thank you for your valuable reply and sorry for late reply to you It's working fine again thank you Bradley.....