logo

New Response

« Return to the main article

You are replying to:

  1. Dear Jake,

    I'm new at java and i need send an html email by an agent. I'm try to run agent from the agent view with the code below (is copy from your!!!).

    The problem is, after click the RUN at action menu, give me this message error:

    "Started running agent 'WQS-SendURL' on 16/08/2002 15:03:24 ERROR: Server error: Entry not found in index Ran Java Agent Class Done running agent 'WQS-SendURL' on 16/08/2002 15:03:24 "

    Is because it can't find the java.io / java.net / java.util ???

    Any help is welcome!!!

    Thks

    Daniela

    import lotus.domino.*; import java.io.*; import java.net.*; import java.util.*;

    public class JavaAgent extends AgentBase {

    public void NotesMain() {

    PrintWriter pw = getAgentOutput(); String dbpath=null;

    try { Session vNotesSession = getSession(); AgentContext vNotesAgentContext = vNotesSession.getAgentContext(); Database vNotesDatabase = vNotesAgentContext.getCurrentDatabase(); String sSMTPHostAddress = "smtp.acme.com"; Vector vToTrue = "joao@acme.com"; String sToShow = "Joao"; String sFromTrue = "peter@acme.com"; String sFromShow = "Santa Maria"; String sSubject = "Envio de eMail SMTP"; URL vURLToMail = new URL("www.lotus.com"); HtmlMessage msg = new HtmlMessage( sSMTPHostAddress ); msg.sendMessage( sFromTrue, sFromShow, vToTrue, sToShow, sSubject, vURLToMail ); } catch ( MalformedURLException e) { System.err.println( "Malformed URL: " + e.getMessage() ); //pw.println( "error 1"); } catch ( UnknownHostException e) { System.err.println( "Can\'t connect to host: " + e.getMessage() ); //pw.println( "error 1"); } catch ( FileNotFoundException e) { System.err.println( "404 Can\'t find specified resource: " + e.getMessage() ); //pw.println( "error 3"); } catch ( SMTPException e) { System.err.println( e.getMessage() ); //pw.println( "error 4"); } catch( Exception e) { e.printStackTrace(); } } }

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: