Hi All
I have created the following agent with the trigger of Before New Mail Arrives.
I the mailin database where the agent lives received an email where the subject matches “Test Email” it will forward the email on to another email address.
The agent works fine until the email received contains an attachment.
I know that it processed the email because the original email gets some fields updated and is stored in the mailin database. But the email is not sent on to the forwarding address.
As soon as the email is sent again without the attachment it works.
I have checked the logs and can not see any record the the email being routed, or held, there is nothing in the mail boxes on the server
Any ideas?
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
’ Get all documents agent should run on e.g. Mailed documents
Set collection = db.UnprocessedDocuments
’ Loop around each document
Set doc = session.documentcontext
If doc.Subject(0) = "Test Email" Then
Call doc.replaceitemvalue("intForwarded",1)
Call doc.replaceitemvalue("Principal","Joe Bloggs/OU/O")
Call doc.Save( True, True )
' Set who should recieve doc
doc.sendto = "Seymour Butts@MYDomain"
' Set Subject
doc.subject = "Reply from AutoForward - " + " Subject: " + doc.subject(0)
' Send document
Call doc.send(False)
End If