Domino Code Fragment

Code Name*
OpenMailLog method
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.118.45.162
Description*
This agent script opens up a mail log. When the close method is called, the mail memo is sent to the owner of the agent with the name of the agent and the title of the database in the Subject.
Type*
Java
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
import lotus.notes.*;
import java.util.Vector;


public class openmaillogagent extends AgentBase
{
 public void NotesMain()
 {
   try
   {
     Session s = getSession();
     AgentContext ac = s.getAgentContext();
     Agent agent = ac.getCurrentAgent();
     Database db = ac.getCurrentDatabase();
     Log log = s.createLog(agent.getName());
     Vector v = new Vector();
     v.addElement(agent.getOwner());
     log.openMailLog(v, agent.getName() +
     " in " + db.getTitle());
     log.close();    
   }
   catch (Exception e)
   {
     e.printStackTrace();
   }
 }
}