How to change the Sent by field value in Mail programatically

Hello everyone

Can anybody please tell me how can i change the default value in “Sent by” field in Notes mail.

I have to change it programatically. Iam using an Agent with the following code

            Dim s As New NotesSession

Dim doc As NotesDocument

Dim db As NotesDatabase

Set db=s.CurrentDatabase

Set doc=db.CreateDocument

doc.form="Memo"

doc.sendto="Ryan Sanders"

doc.principal="Testing System"

doc.sentby="Online Test System"

doc.subject="This is atest mail ."

Call doc.Send(False,True)

using the above code iam able to change the value of the field “who sent” by using the “Principal” field. but when opening the mail the value of the “Sent by” field is given as " Ryan sanders".

This is because it is taking the id of the person who is using the DB and who has signed the agent. now if i want to change the default name from :Ryan sanders" as “Online Test System”. what should i do ?.

Help on this is much appreciated.

Thanks

VJ

Subject: How to change the Sent by field value in Mail programatically

Hi VJ ,

Just add this line.

doc.DisplaySent=“Online Test System”.

Actually both “Principal” and “DisplaySent” fields needs to be set.

regards ,

Vignesh

Subject: RE: How to change the Sent by field value in Mail programatically

Hai Vignesh

Thanks for the help buddy . its just working fine