It's all about the answers!

Ask a question

Send Email for Java API

Pankaj Sharma (40758) | asked Jan 27 '16, 10:55 a.m.
edited Jan 27 '16, 10:55 a.m.
 Hello Team,
I am trying to send email using Java API in follow-up action, but i am getting following compile time error on mymailerService.sendMail()
The type javax.mail.MessagingException cannot be resolved. It is indirectly referenced from required .class files

I am using the following code:
IMailerService mymailerService = getService(IMailerService.class);
MailSender sender = mymailerService.getDefaultSender();
System.out.println("RTC Mail Service is ENABLED!!");
mymailerService.sendMail(sender, contributor.getEmailAddress(), "Test Notification: Dependent WorkItem", "Hello. The dependent work Item is completed", ""); 
} else {
System.out.println("RTC Mail Service is Not ENABLED!!");

I have updated pre requisits in plugin.xml as well

               <requiredservice interface="" /> 
  <requiredservice interface="" />
   <requiredservice interface="" /> 
Please help me, Thanks in advance

One answer

permanent link
Ralph Schoon (62.0k33643) | answered Jan 27 '16, 11:04 a.m.
You are missing some dependencies in the meta.inf. See Due Date Notifier – an Asynchronous Task Example for the dependencies that did it for me.

Your answer

Register or to post your answer.