QUESTION POSED ON: 19 July 2005
I have an agent which takes an inbound e-mail and forwards it. The forward recipient e-mail address is taken from the Subject field (the actual subject is left in the field). This works, but I cannot get the message to encrypt. This should work, since if I define the recipient in the script, it does. But when I'm parsing it out from the subject field, it won't encrypt. What am I missing?
Here's the agent script:
REM Recipient is split from Subject field.
REM Agent is set to run before new mail.
REM Agent security is set to 2.
Sub Initialize
Dim session As NotesSession
Set session = New NotesSession
Dim db As notesdatabase
Dim Maildoc As notesdocument
Set db = session.CurrentDatabase
Dim doc As NotesDocument
Set doc = session.DocumentContext
Dim ret As Variant
Dim teststr As String
Dim delim As String
teststr = doc.Subject(0)
delim = "&"
ret = Split(teststr, delim)
Print ret(0)
Print ret(1)
Set Maildoc = New NotesDocument( db )
Call doc.CopyAllItems( Maildoc, True )
Maildoc.From = doc.From(0)
Maildoc.Form = "Memo"
Receipient = ret(0)
Maildoc.Subject = ret(1)
Call Maildoc.Save( True, True )
Maildoc.EncryptOnSend = True
Call Maildoc.Send (False, recipient)
Call Maildoc.RemovePermanently(True)
End Sub
|