Agent to Send a mail attachment does not work when Schedulled?

Hi All,

I have an agent, schedulled to run on the server, to send a mail to a receipient.

When I run the agent from the designer, (Agent-Run )it works perfectly, But when I schedulled to run the same (daily ) ,task not performed(i.e. mail not sent to the receipient)

But when I see the Agent Log I can see as the details as agent run succuessfully.

This is the agent for your consideration:

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim docMemo As NotesDocument

Dim rtitem As NotesRichTextItem

Dim strFileName As String

Set db = session.CurrentDatabase

'Get file 1. and attach to mail.

strFileName = Dir$(“\Delm25\datasources\TMS\Daily Sales.asc”, 0)

If strFileName <> “” Then

Set docMemo = db.CreateDocument

Call docMemo.ReplaceItemValue(“Form”, “Memo”)

Call docMemo.ReplaceItemValue(“Subject”, "Cognos Reports- Daily Sales ")

Call docMemo.ReplaceItemValue(“Principal”, “Auto Post”)

Call docMemo.ReplaceItemValue(“SendTo”, “Mira Pimbi/SYA/Vision”)

Set rtitem = New NotesRichTextItem(docMemo, “Body”)

Call rtitem.AppendText(“Hi Stewart . Here is Daily Sales Report.”)

Call rtitem.AddNewLine(1, True)

Call rtitem.EmbedObject (EMBED_ATTACHMENT, “”, “\Delm25\datasources\TMS\Daily Sales.asc”)

Call docMemo.Send(False)

End If

End Sub

Could someone help, to get this work when it is schedulled please??

Thanks in Advance

I set the file path to the same server where Domino is running ( Domino 6)

And the I have the rights to run unrestricted agents set in the Domino server.

In the agent properties I have selected 'property settings no:2 - Allow restricted operations.

Even I tried changing it to option 3 - Allow restricted operations with full administration rights…

Subject: 3 things try you can

Hi Mira,

you can try 3 things:

a) Map a drive on the server to \Delm25\datasources\TMS and then use Driveletter:\sales.asc for the file name

b) attach the file to the document rather the RichText item

c) save the document before sending (you might need to schedule an agent to delete it later if you don’t want to build an archive of sales reports.

May the force be with you.

:slight_smile: stw

Subject: Agent to Send a mail attachment does not work when Schedulled???

If your Domino Server is running as a service, it runs under the System Account, which does not have access to network shares.

You will have to move the files to the Domino Server, or get them using some other method such as ftp if the other system supports it.

When you run it from the Designer Client it runs under the users account on the system the designer is running on, thus has access to the network share.