It's all about the answers!

Ask a question

Send mail Using RTC sdk

Nilesh Patil (1733550) | asked Dec 10 '12, 7:19 a.m.
I want to send mail to user when some conditions are satified. I have return operation advisor for this, in that I am checking some condition, if condition satisfied I want to send mail to user. Can anybdy tell me how can I achive this?. I am trying this using IMailerService .

One answer

permanent link
sam detweiler (12.5k6191201) | answered Dec 10 '12, 9:05 a.m.
edited Dec 10 '12, 12:01 p.m.
ok.. what is the question?

here is the method definition

public void sendMail(MailSender sender, String toAddress, String subject, String msg, String cc) throws MessagingException;

and a sample use
      try {
           IMailerService mailerService = getService(IMailerService.class);
           mailerService.sendMail(mailerService.getDefaultSender(), "toAddress", "subject", "msg", "cc");
      catch(Exception ex)
           System.out.println("exception="+ ex.getMessage());

Nilesh Patil commented Dec 10 '12, 1:24 p.m. | edited Dec 11 '12, 6:50 a.m.

Hi Sam,
  I have done same thing in my code.  It's not giving any exception, but the problem is that the email is not getting triggered. Do I need to do any server configuration settings? Any property I need to  set? SMTP configuration(like server port, server name)? .

sam detweiler commented Dec 10 '12, 8:33 p.m.

you have to configure the server to be able to send mail at all.

see the JTS/Admin, Email configuration

Your answer

Register or to post your answer.