2

我们使用的是 maximo 6.2.3 版本。为了发送特定要求的电子邮件,我们在 Mxserver 类(psdi/server/Mxserver.class)中使用 sendemail 方法。

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

在 mxserver 类中还有一个方法,我可以在其中添加多个电子邮件地址TO

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

mxserver 类中的方法,用于在 TO 中添加一个电子邮件地址和一个 cc

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

我的要求是在 TO 中添加一个电子邮件地址,在 CC 中添加多个电子邮件地址。我该怎么做?

提前致谢

4

1 回答 1

0

我按照以下方式使用它,它工作正常。

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();
            }
        }
于 2018-08-16T15:14:18.927 回答