Q
Get started Bring yourself up to speed with our introductory content.

Debugging a mail agent

I have an agent that runs if documents have been created or modified. The agent uses the NotesDocument Send method to send an email. The agent keeps failing with an error 4000 "The remote server is not a known TCP/IP host."

The server is able to ping the host portion of the email address. The agent also works when I run it manually from my client.

I searched the discussion groups for hours to no avail.

Here is the code:

 Dim session As New NotesSession Dim db As NotesDatabase Dim view As NotesView Dim doc As NotesDocument Dim docCurrent As NotesDocument Dim docMail As NotesDocument Dim item As NotesItem Set db = session.CurrentDatabase Set view = db.GetView( "Requests" ) Set doc = view.GetFirstDocument While Not (doc Is Nothing) 'Notify requester of the change Set docMail = New NotesDocument(db) Set item = docMail.ReplaceItemValue("Form", "Memo") Set item = docMail.ReplaceItemValue("SendTo", doc.EMail(0)) Set item = docMail.ReplaceItemValue("Subject", "Your Pump Doctor Password") Set rti = New NotesRichTextItem(docMail, "Body") Call rti.AppendText("Thank you for registering.") Call rti.AddNewLine(2) Call docMail.Send(False) 'Now set flag so the request will not get reprocessed. Set docCurrent = doc Set doc = view.GetNextDocument(doc) docCurrent.Processed = "Y" Call docCurrent.Save(True, False) Wend


I wish I could help you with this, but it looks like it would take some detailed debugging. We are not set up to do this through the SearchDomino expert forums. You can understand why, since debugging can sometimes go quickly and sometimes take a very long time.

I will offer one tip though... When code works from the client, but not from the server, the problem is usually permissions rather than a bug. Check the Agent Restrictions in the Security tab of the server document in NAMES.NSF. Make sure the signer (last saver) of the agent has the right permissions to run this agent.


Dig Deeper on Domino Resources - Part 3

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close