Agent on incoming email
Posted on 2006-06-13
Hello all, can someone help me out?? I want to create an agent the will run against a mail file when new messages are recieved. Basically it will grab the message, create a new message (to change the from attributes), insert the original body and subject contents, send the new message, delete the originall message. Its going to turn the mail box into a forwarding box. I thought I had it but must be missing something. Its finally to where it will send the message but I can't seem to get the contents of the original message. I'm probably missing something stupid. Can someone help me out??? Thanks!!!
On Error Resume Next
Dim Session As New NotesSession
Dim SendDoc As NotesDocument
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIdocument
Set uidoc = workspace.currentdocument
Set doc = Session.DocumentContext
Set db = Session.Currentdatabase
Set SendDoc = New NotesDocument(db)
SendDoc.Form = "Memo"
SendDoc.SendTo = "firstname.lastname@example.org"
SendDoc.Subject = "Msg Forward"
SendDoc.Principal = "message.forward.zyx.com"
SendDoc.From = "message.forward.zyx.com"
SendDoc.Body = uidoc.FieldGetText("Body")
It sends the message but the body is blank!! Thanks!!