java 访问 domino_用Java通过DIIOP远程操作Domino服务器

public abstract class Domino {

private final String host="dminoHost";

private final String user="steeven";

private final String pwd="password";

private final String IOR = "IOR:010000002900000049444c3a6c6f7475732f646f6d696e6f2f636f7262612f494f626a6563745365727665723a312e3000000000010000000000000054000000010101000e0000003133332e3232312e3138382e3100acf6310000000438353235363531612d656336382d313036632d656565302d303037653264323233336235004c6f7475734e4f4901000100000000000000";

protected lotus.domino.Session s;

public Domino() throws NotesException{

createSession();

System.out.println("domino:" s.toString());

}

private void createSession() throws NotesException{

// s = NotesFactory.createSession(host,user,pwd);

// s = NotesFactory.createSessionWithIOR(IOR,user,pwd);

s = NotesFactory.createSessionWithIOR(IOR);

}

}

===================================================================================

File: Sendmail.java:

===================================================================================

package steeven.lotus;

import lotus.domino.*;

import java.util.*;

//import lotus.notes.*;

public class Sendmail extends Domino{

java.util.ArrayList grpUsers = new java.util.ArrayList();

Database db;

Document memo;

RichTextItem rti;

private Vector to = new Vector();

private boolean attachForm = false;

static String mailFooter = "\n\n\n此邮件由WebMail发送 http://www/mail.jsp\n\n";

public Sendmail() throws NotesException{

System.out.println("sendmail");

db = s.getDatabase(null,"WebMail.nsf");

memo = db.createDocument();

rti = memo.createRichTextItem("Body");

memo.setEncryptOnSend(true);

memo.setSignOnSend(true);

memo.sign();

memo.setSaveMessageOnSend(true);

}

public Sendmail(String to,String from,String subject,String body) throws NotesException{

this();

setSendTo(to);

setFrom(from);

setSubject(subject);

setBody(body);

System.out.println("Sendmail with contructor");

}

public Sendmail(String to[],String from,String subject,String body) throws NotesException{

this();

setSendTo(to);

setFrom(from);

setSubject(subject);

setBody(body);

System.out.println("Sendmail with contructor");

}

public void setSubject(String n) throws NotesException{

memo.appendItemValue("Subject",n);

}

public void setFrom(String n) throws NotesException{

memo.appendItemValue("Principal",n);

}

public void setSendTo(String n) throws NotesException{

to.add(n);

memo.appendItemValue("SendTo",n);

}

public void setSendTo(String n[]) throws NotesException{

appendArray("SendTo",n);

for(int i=0;i

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值