Examples: setParamVal method

This example creates a multi-part MIME entity, setting parameter values as necessary. It uses an X-Notes-Item header to generate the Form item.

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here)
      Stream stream = session.createStream();
      session.setConvertMIME(false);
      // Do not convert MIME to rich text
      Database db = agentContext.getCurrentDatabase();
      Document doc = db.createDocument();
      MIMEEntity body = doc.createMIMEEntity();
      MIMEHeader header = body.createHeader("X-Notes-Item");
      header.setHeaderVal("Memo");
      header.setParamVal("name", "Form");
      header = body.createHeader("Subject");
      header.setHeaderVal("MIME message");
      header = body.createHeader("To");
      header.setHeaderVal("Roberta Person");
      stream.writeText("Text of message.");
      body.setContentFromText
        (stream, "text/plain", MIMEEntity.ENC_QUOTED_PRINTABLE);
      doc.send(false);
      // Restore conversion
      session.setConvertMIME(true);
     
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}