I am trying, and have successfully before, to override the standard fields on an email sent by an agent. The Agent is signed by me, which I want to hide. This is the code:
Set docReply = db.CreateDocument
Call docReply.AppendItemValue(“Form”, “Memo”)
Call docReply.ReplaceItemValue(“SendTo”, tMail)
Call docReply.ReplaceItemValue(“From”, “Admin User <” & AdminAddr & “>”)
Call docReply.ReplaceItemValue(“Principal”, “Admin User <” & AdminAddr & “>”)
Call docReply.ReplaceItemValue(“Subject”, “Test”)
Set rt = New NotesRichTextItem(docReply, “Body”)
Call rt.AddNewline(2)
Call rt.AppendText(“some text”)
Call docReply.Send(False)
Call debugLog.LogAction(docReply.GetItemValue(“Principal”)(0))
========
The From field on the form has this formula:
FIELD Principal := @GetProfileField(“CalendarProfile”; “Owner”);
FIELD $LangPrincipal := @GetProfileField(“CalendarProfile”; “$LangOwner”);
FIELD $AltPrincipal := @GetProfileField(“CalendarProfile”; “AltOwner”);
@UserName
========
The agent log shows the Principal and From values as being exactly what they should be. However, the received email has a Principal value like:
George_Owen/Gbg/IBM%IBMPTT@millvale.ibm.com
I am going blind trying to figure this out. Any suggestions on what I am missing? The agent is kicked off in response to new documents, so debugging is a bit difficult without changing the runtime environment.