Script Debugging

I’m trying to use the newsletter class in some script I’m writing for an agent … anyone know what is going on with this problem?

NotesException: Notes error: Special database object cannot be located (mail\kdesilva.nsf)

at lotus.domino.local.Newsletter.NformatMsgWithDoclinks(Native Method)



at lotus.domino.local.Newsletter.formatMsgWithDoclinks(Unknown Source)



at JavaAgent.NotesMain(JavaAgent.java:24)



at lotus.domino.AgentBase.runNotes(Unknown Source)



at lotus.domino.NotesThread.run(NotesThread.java:208)

This is the offending code:

if (dc.getCount() > 0) {

		Newsletter news = session.createNewsletter(dc);

    		news.setSubjectItemName("Subject");

    		news.setDoSubject(true);

    		Document doc = news.formatMsgWithDoclinks(db);

    		doc.appendItemValue("Form", "Memo");

    		doc.appendItemValue("Subject", "Spam Report");

    		doc.send(false, session.getUserName()); }

Subject: By default your mail file has no “Default View”

In order to send a backend message w/ doclinks, you must have a default view assigned. Go to the design of your mailfile and make the ($All) view the default…