2

We are using maximo 6.2.3 version. To send emails for a particular requirement we are using sendemail method in Mxserver class(psdi/server/Mxserver.class).

sendEMail(String to, String from, String subject, String message)

In mxserver class there is a also a method, where I can add multiple email addresses in TO .

sendEMail(String to[], String from, String subject, String message)

Method in mxserver class for adding one email address in TO and one cc

sendEMail(String to, String cc, String bcc, String from, String subject, String message)

My requirement is to add one email address in TO and multiple email addresses in CC. How I can I do that?

Thanks in advance

Siva GV
  • 81
  • 2
  • 13
  • I assume there is nothing like `sendEMail(String to[], String from, String cc[], String subject, String message)` in the API, is there ? – Alp Jun 29 '15 at 09:51
  • If it is there I should have called that method right? – Siva GV Jun 29 '15 at 10:01
  • Yes. The most logical and straightforward solution for the problem would be to add a new method, similar to my above comment, to the API. But there is no such method in the API (as you mentioned).And I assume maximo is not an open source lib (as it looks like it is part of IBMs framework), I don't think you can easily add what you need to the API. So, I am sorry but I can't think about anything else atm. Good luck. – Alp Jun 29 '15 at 10:14

1 Answers1

0

I use it the following way and it works fine.

if(commSetRemote.count() > 0)
        {
            CommTemplate commRemote = (CommTemplate)commSetRemote.getMbo(0);
            SqlFormat sqf = new SqlFormat(getRoot(), commRemote.getString("subject"));
            sqf.setIgnoreUnresolved(true);
            String subject = sqf.resolveContent();
            sqf = new SqlFormat(this, commRemote.getString("message"));
            sqf.setIgnoreUnresolved(true);
            String message = sqf.resolveContent();
            if (message.length() > 0){
                message = message + "";
            }
            String emailList ((CommTemplateRemote)commRemote).convertSendTo("COMMTMPLT_TO", this);
            String sendTo = emailList;

            emailList = ((CommTemplateRemote)commRemote).convertSendTo("COMMTMPLT_CC", this);
            String cc = emailList;

            emailList = ((CommTemplateRemote)commRemote).convertSendTo("COMMTMPLT_BCC", this);
            String bcc = emailList;
            String sendFrom = commRemote.getString("SENDFROM");
            try {
                MXServer.sendEMail(sendTo, cc, bcc, sendFrom,subject, message, sendFrom, null, null);
            } catch (MessagingException e) {
                e.printStackTrace();
            }
        }
Arun PM
  • 35
  • 9