Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Send Email for Java API

 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();
if(mymailerService.isMailEnabled()){
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

<prerequisites>
               <requiredservice interface="com.ibm.team.repository.service.IRepositoryItemService" /> 
  <requiredservice interface="com.ibm.team.workitem.common.IWorkItemCommon" />
   <requiredservice interface="com.ibm.team.repository.service.IMailerService" /> 
            </prerequisites>
Please help me, Thanks in advance

0 votes



One answer

Permanent link
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.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,978

Question asked: Jan 27 '16, 10:55 a.m.

Question was seen: 2,692 times

Last updated: Jan 27 '16, 11:04 a.m.

Confirmation Cancel Confirm