Hi everybody,
I have a script to send me an attachment by email with a Java Agent but when the Agent run it doesn’t send the message to my email.
This is my script:
import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Database db=agentContext.getCurrentDatabase();
Document memo=db.createDocument();
memo.appendItemValue("Form", "Memo");
memo.appendItemValue("Subject", "Prueba - Por favor verify this");
RichTextItem rti = memo.createRichTextItem("Body");
memo.renderToRTItem(rti);
RichTextItem body = memo.createRichTextItem("Body");
body.appendText("Here is the attachment:");
body.addNewLine(2);
body.embedObject(EmbeddedObject.EMBED_OBJECT, "", "c:\\ProcesoPNA.pdf", "Proceso");
Vector v = new Vector();
v.addElement(session.getUserName());
v.addElement("Tonny Cardenas");
memo.setEncryptOnSend(true);
memo.setSaveMessageOnSend(true);
memo.setSignOnSend(true);
memo.sign();
memo.send(true, v);
} catch(Exception e) {
e.printStackTrace();
}
}
}
What am i doing bad?
Thanks and regards.
Ivan Garcia.