Hello everyone,
I have created an Xpage and add a button on that.
On click of that button, I have written the JavaScript
var agent = database.getAgent(“agSendMail”);
agent.runOnServer();
which actually runs an agent in background.
The agent code is written in java. Now when the Agent runs it shows the error:
“Error connecting to sever . The remote server is not known TCP/IP host.”
Here is the code which I have written:
import lotus.domino.*;
public class notesMain extends AgentBase
{
public void NotesMain()
{
try
{
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Database db = agentContext.getCurrentDatabase();
getMailContent getContent = new getMailContent();
getContent.sendmail("Test User1", db);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~getMailContent~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import lotus.domino.*;
import java.util.Vector;
public class getMailContent
{
void sendmail(String sendTo, Database db)
{
try
{
Document memo = db.createDocument();
memo.appendItemValue("Form", "Memo");
memo.appendItemValue("Subject", subject);
memo.appendItemValue("body", body);
Vector v = new Vector();
v.addElement(sendTo);
memo.send(true,v);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
The main class which calls the function sendMail.
I think this error is coming due to some configuration setting in server document. I have access to the server document but dont know what we need to check to resolve this issue.
It would be great if anyone can provide the reference to the detailed server document structure. I mean what is the significance of each and every tab and what should be the values in the field. Server document setting always freak me out.
kindly help me resolving this issue.
Thanks & Regards,
Suchita